This project is read-only.

Transparent Objects

Transparent objects are rendered in a forward renderer. There are better methods, but they need to change the graphic pipeline or even need hardware not supported by XNA.

The shader used in the rendering of transparent objects is a Blinn Phong that accepts the ambient light, one directional light, two point lights and one spot light, with attenuation but no shadows nor masks. The point and spot lights are selected automatically using proximity, the directional light that it is set as sun is also selected as the ambient light attached to the camera.

The solution implemented is effective but generic and I suggest finding the best configuration that your game needs. It is even viable to render the transparent objects in a multi pass forward renderer if transparent objects are very important for your game. Or it is also possible to allow setting manually the lights that affect certain objects.

Transparent objects.jpg
The windshield it is not influenced by the green radioactive spot light because to the attenuation function. The glasses material properties are exaggerated to show the influence of the lights better.

Transparent objects are sorted using the distance of the game object (mesh part could be a lot more precise) bounding sphere center to the camera. This is a quick but potentially problematic approach.

Last edited Jan 23, 2013 at 10:13 PM by jischneider, version 12


No comments yet.