Roger James wrote:

So Collada is giving us emission, ambient, diffuse, and specular elements which can be either a fixed colour or a variable colour acquired from a texture map. In the OpenGL pipeline the lighting calculations are done prior to the fragment shading. The only exception is the specular highlighting which we can optionally postponed until after the fragment shading phase. So I would suggest that the starting position is that any textures in the emission, ambient, and specular elements are ignored. If a texture exists in the diffuse element then a default value (probably white) can be applied as the fixed diffuse colour and the texture used to modulate (GL_MODULATE) the incoming fragment colour in the fixed function fragment shader. The common profile does not allow multiple techniques to used in an effect, i.e. no multitexturing.

I've seen light maps and ambient occlusion maps placed as a texture in the ambient channel along with a regular diffuse texture in the diffuse channel. I've implemented this in my own code with simple fixed-function multitexturing before. Is there a reason not to do this?


If the diffuse channel contains a texture and the shininess element is non zero then specular highlighting should be postponed.

I cannot think of a way of handling the index_of_refraction. Has anyone got any thoughts on this?

That would have to be done with a shader implementing Snell's Law (I'd copy it here, but I don't know how to type a "theta" character. Just look it up on wikipedia if you're interested :-) )


Reflective and reflectivity need further study. Anyone got any ideas?

I think these are intended for environment maps. "Reflective" holds the map itself (or just an overall color), and "reflectivity" specifies the blending factor between the surface and the environment.


That leaves the thorny issues surrounding the transparent and transparency elements. This is what the Collada spec has to say about then in general terms.

It sounds like you've done more research than me here, so I don't think I can contribute much more :-)

--"J"


_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to