Is there any way to support a two sided material applied to a geometry, such that entirely different ambient, diffuse, and texture information is applied to the “inside” and “outside” of that geometry?
I am not talking about simple rendering of both sides of a poly geometry, that’s butt simple.
Imagine a paper photograph that has an image on one side and that “Kodak” logo on the back side. Does that have to be done with two separate outward facing sets of polygons? There’s no way to apply one set of ambient/diffuse/texture to the front faces and another to the back? Even with some of the more advanced extensions that I have not investigated too much into, like register combiners?
I’m looking into supporting 3DSMAX’s double sided material in my engine…
thanks for any ideas,
Two sided lighting is supported by OpenGL. I think that it is not in hardware on most video cards. Two sided texturing as a feature does not exist.
So probably the best/only way to do what you want is to draw the object twice, once with glCullFace(GL_BACK), and once with glCullFace(GL_FRONT).
no you can’t apply 2 textures onto one polygon, you will need to draw 2 polygons.
You’ll need two models to achive what you’re asking. Take a sphere for instance. Make two spheres exactly the same. Make one sphere have counter-clockwise triangles, and the other clockwise triangles. Now enable backface culling, and then draw both spheres. If you have a differant texture for each sphere, you’ll see the one texture if you’re on the outside of the sphere, and the other texture on the inside .
Or just do what j said, given that the texture coordinates are identicle .
You may need to flip the normals though, yes?
Heh, I never thought about that.
Yes, flipping the normals is also necessary, unless you use two sided lighting which, as I mentioned before, will probably give you software rendering. On hardware T&L cards, anyway. Other cards, it’s already done in software, so I can’t see using two sided lighting as being a problem.
Yeah, oh well, I guess that makes supporting 2 sided materials fairly straight forward.