Have jReality programming problems or questions? Post them here.
Post Reply
Posts: 4
Joined: Sat 12. Mar 2011, 07:23


Post by gpo » Sat 12. Mar 2011, 07:51

Has anybody created a mirror surface or object?

Is this what we need:

chapp.setAttribute(CommonAttributes.POLYGON_SHADER+"."+CommonAttributes.SPECULAR_EXPONENT, 22.1);
chapp.setAttribute(CommonAttributes.POLYGON_SHADER+"."+CommonAttributes.SPECULAR_COEFFICIENT, 1.0);
chapp.setAttribute(CommonAttributes.POLYGON_SHADER+"."+CommonAttributes.DIFFUSE_COEFFICIENT, 0.0);

or something like that?

Is there something else drastic needed to create a mirror?


User avatar
Posts: 323
Joined: Thu 14. Dec 2006, 09:56
Location: TU Berlin

Re: mirrors

Post by gunn » Tue 15. Mar 2011, 21:05

Most jReality backends don't do ray-tracing, for example, the JOGL backend doesn't. You can however create an impression of reflections using reflection maps. See this jReality tutorial for details. For a flat mirror, use a quadrilateral, and attach the reflection map to the appearance attached to the scene graph component containing the quadrilateral.
jReality core developer

Post Reply