Thanks for the response Jason.

Jason Daly wrote:
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?


I was assuming that because the lighting equation (blinn)  has already been applied in the pipeline before textures are applied, that if we wanted to use a texture map to supply the ambient terms to that equation, then the lighting equation would have to be somehow re-implemented in a fragment shader. I did not think the the fixed functionality could be configured to handle it, especially the contributions from light sources. I am happy to be wrong in 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 :-) )


I think I will just put a comment in about that and leave it for someone more experienced to implement!
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.


Same as above :-)
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  :-)

The transparency bit is the bit that needs fixing. We are just not handling transparent textures at the moment. I would really appreciate your input in this area, as I feel that I am just wandering about in the wilderness on it at the moment.

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

Reply via email to