PostProcessor, Rendering outside of SunBurn

rated by 0 users
This post has 3 Replies | 2 Followers

Top 10 Contributor
Posts 1,289
SunBurn_Community_Licensee
SunBurn_Contributor
SunBurn_Pro_Licensee
Philippe Da Silva Posted: 02-18-2010 11:01 AM

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

Top 10 Contributor
Posts 5,368
Employee
SunBurn_Studio_Licensee

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:

  • Either avoid rendering the star field if Editor.EditorAttached is true
  • Or avoid adding the editor to the SceneInterface and instead manually call Begin / End on it in this order:

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 tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Top 10 Contributor
Posts 1,289
SunBurn_Community_Licensee
SunBurn_Contributor
SunBurn_Pro_Licensee

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

Top 10 Contributor
Posts 5,368
Employee
SunBurn_Studio_Licensee

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().

Follow me on Twitter – development and personal tweets
Awesome XNA Videos – Lighting, Rendering, and game videos

Page 1 of 1 (4 items) | RSS