Hi,
In my prototype, I'm now rendering a Starfield generated using Custom geometry rendered between the SceneInterface.BeginFrameRendering() and SceneInterface.RenderManager.Render() calls.
I added a new HighDynamicRangePostProcessor instance to the SceneInterface.PostProcessorManager as demonstrated in the HDR example and my whole scene is obviously beneficiating from this post processor.
Now, my starfield looses some of its details: I'm using a noise generated texture to draw a nebula and it gets too bright.
Is there a way for me to remove this from the HDR post processor render target?
I tried rendering it before the SceneInterface.BeginFrameRendering but it seems to get cleared...
Thanks,
Philippe
Hi Philippe,
The post process manager applies all post processing during EndFrameRendering(), you should be able to render the star field afterward. You'll need to leave the depth buffer active to ensure the star field does not render in front of the scene (ie: so it clips against objects already in the scene).
Please note I think the editor clears the depth buffer during Editor.EndFrameRendering() (only when the editor is open, to render the gizmos even when behind objects), so when the editor is open the star field may occlude the scene, however you should be able to get around this using the following:
SceneState.BeginFrameRendering();Editor.BeginFrameRendering();SceneInterface.BeginFrameRendering();<render scene>SceneInterface.EndFrameRendering();<render star field>Editor.EndFrameRendering();SceneState.EndFrameRendering();
Let me know if this makes sense and helps!
Follow me on Twitter – development and personal tweetsAwesome XNA Videos – Lighting, Rendering, and game videos
Thank John,
I'll give it a try as soon as I get back on my development computer.
Just to be sure, if I don't add the Editor to the SceneInterface, will have I also to manually call an Update statement during my main Update calls?
Thanks
Philippe Da Silva:if I don't add the Editor to the SceneInterface, will have I also to manually call an Update statement during my main Update calls?
Ah, yes - sorry about that, you'll definitely need to call Editor.Update() during Game.Update().