Jump to content

GuiObjectView Busticated?


Steve_Yorkshire

Recommended Posts

(Using T3D 3.9) - I did a search for issues on github but only found one which seems unrelated to this problem from Duion https://github.com/GarageGames/Torque3D/pull/1691.


I noticed guiObjectView appears broken.


http://i.imgur.com/uH3El34.jpg


1: There's some funky add alpha and fogging thing going on with the background.

2: When you quit Torque, restart, load a level the object is missing it's texture. Reselecting the object in the Gui Editor seems the only way to restore the texture. Nothing seems to get mentioned in the console that's relevant.


Anyone else seeing this?

Link to comment
Share on other sites

Ah thanks for the tip, didn't see that in the search. I did notice that the renderState in an older version ended with false instead of true though - but that the whole "scene" file had kinda had a big overhaul since. Going back to 2009 guiObjectViewer worked as expected. I still have various older versions of T3D lying around on my HD for reference ;)

Link to comment
Share on other sites

The fog problem is related to a postFX doing its work. In my case it's "GammaPostFX".

That false in sceneRenderState what does is disable all the postFX in the rendering including that problematic one.


Now, it seems that in 3.9 you may need a postFX to render the scene so disabling all of the postFX doesn't do the job.

Get that line to "true" again, then.


With that variable as true, I can think of two ways of fixing it:


1) The easy one.


Well, if GammaPostFX is the one being problematic just disable that particular one.

Look for "core\scripts\client\postFx\GammaPostFX.cs" inside locate "singleton PostEffect( GammaPostFX )".

And make

isEnabled = false;

instead of true.

Also just in case, in "core\scripts\client\postFx\hdr.cs" locate

GammaPostFX.enable();

And just comment it so it isn't enabled later.


HDRPostFX may give issues, too but I'm not sure as I have it disabled.

If you run into it just look for

HDRPostFX.enable();

in "core\scripts\client\postFx\hdr.cs" and "core\scripts\client\postFx\postFxManager.gui.settings.cs" and comment it out.



The problem with this method is that you lose the use of "GammaPostFX" for the normal scene.



2) Hard way. But I don't know if it works for 3.9.


If "GammaPostFX" in the normal RenderPassManager is problematic then... we can use a completely different RenderPassManager without "GammaPostFX".


I'm not sure if this can work in 3.9 but you can try.

First we need our new RenderPassManager.

In "core\scripts\client\renderManager.cs" add just before the closing } of "function initRenderManager()":

 

	new RenderPassManager( GuiObjectViewRenderPassManager );

  GuiObjectViewRenderPassManager.addManager( new RenderPassStateBin() { renderOrder = 0.001; stateToken = AL_FormatToken; } );
  GuiObjectViewRenderPassManager.addManager( new RenderObjectMgr() { bintype = "Sky"; renderOrder = 0.1; processAddOrder = 0.1; } );
  GuiObjectViewRenderPassManager.addManager( new RenderObjectMgr()      { bintype = "Begin"; renderOrder = 0.2; processAddOrder = 0.2; } );
  GuiObjectViewRenderPassManager.addManager( new RenderTerrainMgr()   { renderOrder = 0.4; processAddOrder = 0.4; basicOnly = true; } );
  GuiObjectViewRenderPassManager.addManager( new RenderMeshMgr()         { bintype = "Mesh"; renderOrder = 0.5; processAddOrder = 0.5; basicOnly = true; } );
  GuiObjectViewRenderPassManager.addManager( new RenderImposterMgr() { renderOrder = 0.56; processAddOrder = 0.56; } );
  GuiObjectViewRenderPassManager.addManager( new RenderObjectMgr()     { bintype = "Object"; renderOrder = 0.6; processAddOrder = 0.6; } );

  GuiObjectViewRenderPassManager.addManager( new RenderObjectMgr()     { bintype = "Shadow"; renderOrder = 0.7; processAddOrder = 0.7; } );
  GuiObjectViewRenderPassManager.addManager( new RenderMeshMgr()    { bintype = "DecalRoad"; renderOrder = 0.8; processAddOrder = 0.8; } );
  GuiObjectViewRenderPassManager.addManager( new RenderMeshMgr()        { bintype = "Decal"; renderOrder = 0.81; processAddOrder = 0.81; } );
  GuiObjectViewRenderPassManager.addManager( new RenderOcclusionMgr(){ bintype = "Occluder"; renderOrder = 0.9; processAddOrder = 0.9; } );

  GuiObjectViewRenderPassManager.addManager( new RenderObjectMgr() { bintype = "ObjectTranslucent"; renderOrder = 1.0; processAddOrder = 1.0; } );

  GuiObjectViewRenderPassManager.addManager( new RenderObjectMgr()          { bintype = "Water"; renderOrder = 1.2; processAddOrder = 1.2; } );
  GuiObjectViewRenderPassManager.addManager( new RenderObjectMgr()        { bintype = "Foliage"; renderOrder = 1.3; processAddOrder = 1.3; } );
GuiObjectViewRenderPassManager.addManager( new RenderParticleMgr()    { renderOrder = 1.35; processAddOrder = 1.35; } );

  GuiObjectViewRenderPassManager.addManager( new RenderTranslucentMgr(){ renderOrder = 1.4; processAddOrder = 1.4; } );

  GuiObjectViewRenderPassManager.addManager(new RenderObjectMgr(){ bintype = "ObjectVolumetricFog"; renderOrder = 1.45; processAddOrder = 1.45; } );

  GuiObjectViewRenderPassManager.addManager( new RenderGlowMgr() { renderOrder = 1.5; processAddOrder = 1.5; } );
  GuiObjectViewRenderPassManager.addManager( new RenderPassStateBin()       { renderOrder = 1.7; stateToken = AL_FormatToken; } );

 

The name being "GuiObjectViewRenderPassManager" will be used in the c++ code.

In "source\T3D\guiObjectView.cpp" inside "void GuiObjectView::renderWorld( const RectI& updateRect )"

add just before (our original with true)

 

   SceneRenderState state
  (
     gClientSceneGraph,
     SPT_Diffuse,
     SceneCameraState( GFX->getViewport(), frust, MatrixF::Identity, GFX->getProjectionMatrix() ),
     renderPass,
     true
  );

 

This:

 

   renderPass = dynamic_cast<RenderPassManager*>(Sim::findObject("GuiObjectViewRenderPassManager"));

 

Note the looking for that particular RenderPassManager we created.

You may want to add a sanity check so renderPass isn't modified if "GuiObjectViewRenderPassManager" doesn't exist.


What this method does is to replace "DiffuseRenderPassManager" of the rendering (the default one for Torque3D rendering) with a new one created with all its renderbin without name.

The PostFX activates after and before renderbin with particular names so they will not activate for this RenderPassManager.

You could even add different names to the renderbin and new PostFX for only the guiObjectView scene.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...