GuiObjectView Busticated?

Materials, textures, lighting, postfx
7 posts Page 1 of 1
Steve_Yorkshire
Posts: 191
Joined: Tue Feb 03, 2015 10:30 pm
 
  by Steve_Yorkshire » Sun Jan 29, 2017 5:18 pm
(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.

Image

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?
irei1as
Posts: 66
Joined: Fri Feb 27, 2015 5:13 pm
by irei1as » Sun Jan 29, 2017 5:26 pm
I think it's related to:
viewtopic.php?f=12&t=597
Steve_Yorkshire
Posts: 191
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Sun Jan 29, 2017 9:06 pm
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 ;)
Steve_Yorkshire
Posts: 191
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Sun Jan 29, 2017 9:44 pm
Steve_Yorkshire
Posts: 191
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Mon Feb 06, 2017 6:40 pm
I've noticed that this does not work with Torque3.9 (dx9). Setting the sceneRenderState to false stops the whole model from rendering (sad_trombone).
irei1as
Posts: 66
Joined: Fri Feb 27, 2015 5:13 pm
by irei1as » Sun Feb 12, 2017 6:15 pm
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()":

Code: Select all

   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)

Code: Select all

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


This:

Code: Select all

   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.
Steve_Yorkshire
Posts: 191
Joined: Tue Feb 03, 2015 10:30 pm
 
by Steve_Yorkshire » Thu Feb 16, 2017 9:27 pm
Thanks for the info on PostFX @
User avatar
irei1as
. @
User avatar
Azaezel
gave me a fix to get rendering working again in 3.9
7 posts Page 1 of 1

Who is online

Users browsing this forum: Bing [Bot] and 2 guests