Page 1 of 1

Do I have to Script my textures?!?! Nooooooo!

Posted: Sat May 14, 2005 4:58 am
by Greed
//Can it be this simple?

material DragonflyRed
{
receive_shadows on
technique
{
pass //For Diffuse
{
ambient 0.588235 0.588235 0.588235
diffuse 0.588235 0.588235 0.588235
emissive 0.0 0.0 0.0
texture_unit
{
texture dragonfly.tga
}
}

pass //for alpha
{
scene_blend alpha_blend
texture_unit
{
// texture with included alpha channel
texture dragonfly.tga
}
}

pass //for Specular
{
scene_blend Specular_blend // It aint Specular_blend but sum function its too late too look up now :twisted:
texture_unit
{
// Specular Map
texture dragonflySpec.tga
}
}

pass //for Normal
{
scene_blend Normal_blend //Same as specular but normal
texture_unit
{
// Normal Map
texture dragonflyNormal.tga
}
}
}
}

/* Or is there a way for the exporter to make the script from the mesh with the material assigned to it... straight through the max exporter? .... Please.....I'm not a scripter */ :cry:

Posted: Sat May 14, 2005 2:57 pm
by sinbad
Well for a start you're wasting a lot of power by doing everything as separate passes. GPUs have more than one texture unit, you should use them by having more than one texture_unit entry in a pass.

Please look at the sample material scripts for a normal mapping example.

Posted: Sat May 14, 2005 3:59 pm
by Greed
I'd love to read a thousand templates to know where i'm going.... But where are they?

I know there is something like a shader manual but, unless i'm mistaken, it only list functions, not much help to me if i don't know how to use them...(as in: in which order to write what)

How about a make a shader tutorial?

And i guess there's no way of having Max capture all the layers of textures through the exporter then...and script the shader for me... i mean it already scripts the diffuse pass...?

Posted: Sat May 14, 2005 4:05 pm
by jacmoe
They are in your Ogre Media folder - in materials/scripts - look at the .material files there.

Posted: Sat May 14, 2005 5:37 pm
by Greed
Ha! Thank you very much! that will help a bunch! :D