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

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
User avatar
Greed
Gnoblar
Posts: 11
Joined: Mon May 09, 2005 9:51 pm
Location: Montreal

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

Post 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:
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post 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.
User avatar
Greed
Gnoblar
Posts: 11
Joined: Mon May 09, 2005 9:51 pm
Location: Montreal

Post 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...?
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

They are in your Ogre Media folder - in materials/scripts - look at the .material files there.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Greed
Gnoblar
Posts: 11
Joined: Mon May 09, 2005 9:51 pm
Location: Montreal

Post by Greed »

Ha! Thank you very much! that will help a bunch! :D
Post Reply