Is there an easy way to get the reflection tech and translucency working?
As well, reflections in general? They are not part of the stock shaders.
The Reflection / Refraction example's implementation works great with both opaque and transparent objects. However you will need to make one quick change:
Comment out the final sceneInterface.EndFrameRendering():
// Done rendering. //sceneInterface.EndFrameRendering(); sceneState.EndFrameRendering();
And move the call to before rendering the objects with reflection:
// Clear the depth buffer then render. graphics.GraphicsDevice.Clear(ClearOptions.DepthBuffer, Color.Black, 1.0f, 0); sceneInterface.RenderManager.Render(); sceneInterface.EndFrameRendering(); // Setup and render reflective / refractive pass for water and orbs using additive blending. GraphicsDevice.BlendState = TrueAdditiveBlend;
This change is necessary because transparent objects are rendered during EndFrameRendering(), and the reflection / refraction layer must be rendered afterward. The change is compatible with both transparent and opaque objects.
Let me know if this helps!
Follow me on Twitter – development and personal tweetsAwesome XNA Videos – Lighting, Rendering, and game videos
Thank you. We'll take a look at this!