### Crash in current development branch, on MatInstance::isInstanced()

Expanding and utilizing the engine via C++.

#### Re: Crash in current development branch, on MatInstance::isInstanced()

Tiel
Posts: 25
Joined: Tue Mar 01, 2016 11:39 pm
Forgive my ignorance, but is calef's fix still applicable then? I'm trying to compile what's in the development branch right now with dx11 and running into the same issue when attempting to load an existing project.

#### Re: Crash in current development branch, on MatInstance::isInstanced()

Azaezel
DEVGRU
Posts: 496
Joined: Tue Feb 03, 2015 9:50 pm

For clarity, this is with an empty template derivation? if so:

https://github.com/GarageGames/Torque3D ... bec33392R4 is the bit where deferredClearGBufferP was added. (further down is the file. though again, you'll want the dx11 templated version from full at time of writing, and again they'll be in a different spot soon.)

#### Re: Crash in current development branch, on MatInstance::isInstanced()

Tiel
Posts: 25
Joined: Tue Mar 01, 2016 11:39 pm
Ah, yes, got it. I went ahead and just stripped all the art and a good deal of script files from full and put my own stuff in, good to go.

Though with DX11 enabled in the project @ CMAKE there are a few strange artifacts.

(this is a guiobjectview with a model of an earth like planet with normals and specular. Or it would be, anyway, heh)

Went into options, there's a handy dropdown to switch the GPU over to D3D11, but restarting yields

failed to compile shader: C:\Users\cocka\Desktop\Torque3D-development\My Projects\Void\Null\game\shaders\procedural\5004b9ce_P.hlsl(52,23): error X3086: the 'sampler2D' keyword is deprecated in strict mode; use 'SamplerState' instead
C:\Users\cocka\Desktop\Torque3D-development\Engine\source\gfx\D3D11\gfxD3D11Shader.cpp(924,0): {Fatal-ISV} - Unable to compile shader!

I am lost haha, should I create a thread for this?

#### Re: Crash in current development branch, on MatInstance::isInstanced()

Timmy
Posts: 378
Joined: Thu Feb 05, 2015 3:20 am
If you see any problems with DX11, just pile them up in this thread and i'll fix as they come in http://forums.torque3d.org/viewtopic.php?f=40&t=473

#### Re: Crash in current development branch, on MatInstance::isInstanced()

rlranft
Posts: 309
Joined: Thu Feb 05, 2015 3:11 pm

GuiObjectView is a horrible, horrible thing - it needs a ton of work to bring it in line with the other 3D view elements.

#### Re: Crash in current development branch, on MatInstance::isInstanced()

TorqueFan
Posts: 130
Joined: Thu Apr 30, 2015 5:35 am
GuiObjectView is a horrible, horrible thing - it needs a ton of work to bring it in line with the other 3D view elements.
I use GuiObjectView rather extensively in my current project. Recently I've extended the GuiObjectView class with 4 new features that make it much more usable:
• Added sub mesh support : To show and hide sub-meshes within a parent mesh( source code and console commands ).
• Added sub mesh skinning : To change skins individually per sub-mesh within a parent mesh( source code and console commands ).
• Added node support : To toggle on/off use of nodes on the mesh. If in use, camera can be set to node locations( source code and console commands ).
• Added blend support : To use blend animations with the displayed mesh. Supports blending animations with root animation pose( source and console commands ).
Are there other features that you'd like to see @ rlranft ? When I get time to clean up my code and revisit this I plan on sharing this improved GuiObjectView class with our community, so please do let me know if there are improvements that might be able to be made.

#### Re: Crash in current development branch, on MatInstance::isInstanced()

rlranft
Posts: 309
Joined: Thu Feb 05, 2015 3:11 pm

You'll probably want to talk to @
Azaezel
about the real issues (I believe he's addressing several render-related issues now or shortly) - mainly it doesn't have all of the rendering features that the GameTSCtrl, nor does it play nice when rendered as a child of GameTSCtrl. The reason that I say "it's horrible" is because it leads you to believe that it's going to behave like a "show room" version of GameTSCtrl, but that's not true and there are plenty of gotchas.

As far as functionality, it has what I need - it just causes endless questions from newcomers....

#### Re: Crash in current development branch, on MatInstance::isInstanced()

TorqueFan
Posts: 130
Joined: Thu Apr 30, 2015 5:35 am
Yea I can see where some improvements could go a long way in some areas.

Thanks for the information about a potential WIP around the GuiObjectView's rendering code. I'd be interested to see what changes @
Azaezel
makes to the class! Hopefully he'll chime in and let me know =)

#### Re: Crash in current development branch, on MatInstance::isInstanced()

Azaezel
DEVGRU
Posts: 496
Joined: Tue Feb 03, 2015 9:50 pm

Lesee.. Da List...

Fars it goes, thusfar, there's of course the https://github.com/GarageGames/Torque3D ... f8bf4cL525 addition that'll let it take postfx (I say 'let it', but that's really a deferred requirement that just happens to allow stuff like HDR to apply. Be nice to specify which ones long term so you could apply specialty effects to a cutout, but not particularly targeting that atm.)

Do still need to sort out why OpenGL is pitching a fit with non forward lit materials:
http://i.imgur.com/ZeazIPx.jpg

Could be related to this glitch: http://imgur.com/a/U8qvC *

For folks planning on using em in-game need to sort out the blend methodology so that it throws out that background quad (that brightening crap you can see http://i.imgur.com/wDLW46I.jpg **). Prolly somethin up with the stateblock...

Should also note at time of writing I've thusfar failed to inject the levelinfo cubemap global reference into the guiobjectview, material, or object editor scene variants. (Important for metals later. No envoronment/ibl/ect map/some kind of dropdown-selected cubemap, then it ends up showing that as black.)

*should note that in order to support guiobjectviews prior to a level load, need to shift https://github.com/GarageGames/Torque3D ... #L106-L115 on up to about https://github.com/GarageGames/Torque3D ... nit.cs#L73

** one thing I did add so far in tinkering around would be the missing entries for fog filtering from the other two variants on that theme:
https://github.com/GarageGames/Torque3D ... w.cpp#L371
+
https://github.com/GarageGames/Torque3D ... w.cpp#L418
which nets us

Code: Select all

 void GuiObjectView::renderWorld( const RectI& updateRect ) { if( !mModel ) return; GFXTransformSaver _saveTransforms; // Determine the camera position, and store off render state. MatrixF modelview; MatrixF mv; Point3F cp; modelview = GFX->getWorldMatrix(); mv = modelview; mv.inverse(); mv.getColumn( 3, &cp ); RenderPassManager* renderPass = gClientSceneGraph->getDefaultRenderPass(); S32 time = Platform::getVirtualMilliseconds(); S32 dt = time - mLastRenderTime; mLastRenderTime = time; LIGHTMGR->unregisterAllLights(); LIGHTMGR->setSpecialLight( LightManager::slSunLightType, mLight ); GFX->setStateBlockByDesc(mRenderDesc); F32 left, right, top, bottom, nearPlane, farPlane; bool isOrtho; GFX->getFrustum( &left, &right, &bottom, &top, &nearPlane, &farPlane, &isOrtho ); Frustum frust( false, left, right, top, bottom, nearPlane, farPlane, MatrixF::Identity ); FogData savedFogData = gClientSceneGraph->getFogData(); gClientSceneGraph->setFogData(FogData()); // no fog in preview window SceneRenderState state ( gClientSceneGraph, SPT_Diffuse, SceneCameraState( GFX->getViewport(), frust, MatrixF::Identity, GFX->getProjectionMatrix() ), renderPass, true ); // Set up our TS render state here. TSRenderState rdata; rdata.setSceneState( &state ); // We might have some forward lit materials // so pass down a query to gather lights. LightQuery query; query.init( SphereF( Point3F::Zero, 1.0f ) ); rdata.setLightQuery( &query ); // Render primary model. if( mModel ) { if( mRunThread ) { mModel->advanceTime( dt / 1000.f, mRunThread ); mModel->animate(); } mModel->render( rdata ); } // Render mounted model. if( mMountedModel && mMountNode != -1 ) { GFX->pushWorldMatrix(); GFX->multWorld( mModel->mNodeTransforms[ mMountNode ] ); GFX->multWorld( mMountTransform ); mMountedModel->render( rdata ); GFX->popWorldMatrix(); } renderPass->renderPass(&state); gClientSceneGraph->setFogData(savedFogData); // restore fog setting // Make sure to remove our fake sun. LIGHTMGR->unregisterAllLights(); } 

#### Re: Crash in current development branch, on MatInstance::isInstanced()

rlranft
Posts: 309
Joined: Thu Feb 05, 2015 3:11 pm

I've got a case where I'm using it for a character preview in 3.5.1 and it functions for that just fine, especially because I'm not doing anything but displaying a player model - no "part changing" or skin swapping or anything, just show available player models. But as we all know, this is tool cool of an idea to not want to see it "done right." Thanks @
Azaezel
and @
TorqueFan