About Store Forum Documentation Contact



Post Reply 
Custom Meshs
Author Message
Brainache Offline
Member

Post: #16
Re: Custom Meshs
Oh how I love it when its an easy answer! Thanks!
04-16-2009 01:05 AM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #17
Re: Custom Meshs
Hey there... Couple more for ya...

When I create my materials and save them... the blue channel no longer functions. (if I load the material in the material editor, and adjust the blue slider.. nothing happens.. ).... If I change the technique to anything other than default.. the color chanels work... switch back to default and the blue doesnt work.

Also - the gfx files that I convert are fuzzy looking, when compared to a gfx created from the same texture during a direct x .x file drag-n-drop import...

This is how I am creating the .gfx:

Gfx gfx;
gfx.Import(tName,-1,GFX_2D);
gfx.save(mName);

The -1 for GFX_TYPE is the only thing I can think of that might be causing the fuzzy gfx.. but I get crashes when changing the value...

Here is how I am creating the .mtrl file:

mat.reset();
if (dif) mat.diffuse=Gfxs(gfxName);
if (nor) mat.normal=Gfxs(norgfxName);
mat.technique = MTECH_DEFAULT;
mat.ambient.set(0,0,0);
mat.color.set(1,1,1,1);
mat.save(matName);

I've tried it without the technique,ambient, and color setting - same result.. no blue channel...

Suggestions?
04-16-2009 02:02 AM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #18
Re: Custom Meshs
Solved the fuzziness by setting mip map levels ( gfx.Import(tName,-1,GFX_2D,4,false); )

The blue channel has be comlpeted stumped tho... when I adjust the slider in the material editor.. the preview changes.. but not the material on the model.. unless I change the rendering technique...
04-16-2009 05:03 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #19
Re: Custom Meshs
normal textures in Mesh Editor are created in a specific way, not just using Import
maybe this is causing the problem
I'll try to make that function available which generates textures for a material

Oh, and important: some of the texture creation algorithms use Direct3DDevice, which is available only after Init (and not inside InitPre)
so they may not work properly in some cases, this of course applies to the InitPre phase
04-16-2009 05:13 PM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #20
Re: Custom Meshs
Ok - Im doing this on a machine with the engine running, during the init function, so directx should be good...

I have discovered that it is not the material causing it... its the mesh.

When I apply the same material to a different mesh - all colors work correctly...

What on the mesh ( or mesh parts, or mshb) could be causing this?
04-16-2009 05:22 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #21
Re: Custom Meshs
vertex colors?
04-16-2009 05:23 PM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #22
Re: Custom Meshs
Here is where I create the verts...

Vtx3D &vert = poly.New();
vert.pos.x = brush->verts[idx].v[0];
vert.pos.y = brush->verts[idx].v[1];
vert.pos.z = brush->verts[idx].v[2];
vert.tex0.x = face->texCoords[x].v[0];
vert.tex0.y = face->texCoords[x].v[1];
vert.color.set(1,1,1,1);

I added the vert.color.set(1,1,1,1).. didnt change anything...

Hmm.
04-16-2009 05:29 PM
Find all posts by this user Quote this message in a reply
Brainache Offline
Member

Post: #23
Re: Custom Meshs
bingo!

vert.color.set(255,255,255,255);

Thanks!
04-16-2009 05:33 PM
Find all posts by this user Quote this message in a reply
Post Reply