quote:Original post by c t o a n
...
thanks now I'm starting to understand more about this effect thing.
quote:Original post by sBibi
I was just wondering... has anyone implemented meta bouncing as Yann described it? or something similar? that is, automatic effect bouncing without any explicit links.
I have some kind of meta-bouncing... not the same as Yann described though
the shaders in my engine is broken down so that different "Effects" needs several shaders to be visible I have one shader that apply the Ambient and diffuse color of the material and another that sets the Specular and shininess if I need all four then all four are choosen, and then a third shader that applies a texture (or several) I choose them through a bit-field as an MaterialEffect description and the bit-field is set depending on what the Material has e.g. Texture etc.
EDIT:
I have been thinking.. if I create an Effect file that looks like this
--- Effects.fx ---
Effect 0
{
.description "Diffuse color"
.vertexstreams (position, normal)
.datastreams COLOR(ambient, diffuse)
}
Effect 1
{
.description "Diffuse texture"
.vertexstreams (position, normal, texcoord)
.datastreams TEXTURE(diffuse)
}
Effect 2
{
.description "Diffuse textured with lightmap"
.vertexstreams (position, normal, texcoord)
.datastreams TEXTURE(diffuse,lightmap)
}
And some material scripts that looks something like this to describe the material of the current mesh:
--- some Material scripts ---
Material "Diffuse blue"
{
.Effect "Diffuse color"
.color.ambient = 0.2 0.2 0.4
.color.diffuse = 0.4 0.4 0.8
}
Material "simple marble textured"
{
.Effect "Diffuse texture"
.texture.diffuse = "textures\marble.tga"
.texture.texcoordset = 0
}
then the egine knows when it encounter the .Effect line that the material is built from that effect..
[edited by - McZ on April 16, 2004 8:08:13 AM]