Pre-Pull Request: D3D11 Initial testing

This forum is for tracking and working on active issues that need to be resolved, as well as testing Pull Requests that are waiting to be integrated into Torque 3D.
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7
64 posts Page 5 of 7
Timmy
Posts: 306
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Tue Apr 05, 2016 1:53 pm
Yeah no worries, just remember there are other large changes sitting in devhead at the moment compared to release 3.7. The other big change is deferred shading.
TorqueFan
Posts: 87
Joined: Thu Apr 30, 2015 5:35 am
by TorqueFan » Tue Apr 05, 2016 5:46 pm
I'll keep that in mind, although the project was sync'd with 3.8 development prior to this coming up. There are a lot of moving parts on my end that tie into this, though, so I just have to do the work.

This update is significant enough that I am keeping a build sync'd with its changes. After I pop the hood and iron out my issue I'll let you know about what went wrong for me.

Thanks again for all your efforts, and to all contributors!
TorqueFan
Posts: 87
Joined: Thu Apr 30, 2015 5:35 am
by TorqueFan » Wed Apr 06, 2016 10:55 pm
@
User avatar
Timmy

I have ported over probably 3/4 of the project now, and hope to finish by tonight or tomorrow. :geek:

Along the way, I have been pleasantly surprised to find many things working great. I know some of this isn't directly related to the D3D11 PR, but figured I'd list it all here for completeness. Here's a recap, I did find one tiny issue so far:

Tested OK with D3D11 :
  • All imported models work flawlessly. This includes multiple materials, animations, blends, you name it...D3D11 OK
  • All imported custom GUI's work flawlessly(20-ish + GUIs). This includes fading GUI's and so on that use custom rendering code...D3D11 OK (more on GuiObjectView below)
  • Entire rework of scripts dealing with customizing, connecting, and launching a new mission all work flawlessly...D3D11 OK
  • All custom terrainGen source and scripts generating flawlessly...D3D11 OK (still hooking in terrain materials this evening but the terrainGen is good)
  • Custom .mis files including many of T3D's existing classes work flawlessly...D3D11 OK

Still to Test with D3D11:
  • Full implementation of extended GuiObjectView class...PENDING
  • Finish hooking in materials for terrain, groundcover, etc...DONE
  • DragControls in drag/drop interface...DONE

One Small Issue with D3D11 found so far:
  • Added a guiProgressCtrl to a GUI and when I set the value up so the progress bar would show some progress - the progress rectangle wasn't rendered perfectly within the border of the control's extents. Not sure if anything dealing with calls to drawRect() or similar were altered but I figured I'd bring that up.

About extending GuiObjectView class:
Basically prior to D3D11 I had 4 features added to the GuiObjectView class so I am currently just plugging them all back in one by one. The good news is my GUI's using GuiObjectView all still work, albeit with far less features. I did get the sub-mesh support plugged in and working again today, so one can hide/show sub-meshes on the model in view using script. Just 3 more features to go... :D
Last edited by TorqueFan on Thu Apr 07, 2016 6:54 am, edited 1 time in total.
TorqueFan
Posts: 87
Joined: Thu Apr 30, 2015 5:35 am
by TorqueFan » Thu Apr 07, 2016 6:41 am
Quick Update( The good so far ) :
  • Terrain materials all work great. Diffuse, Normal, Specular tested. Even works when the terrain is generated and layers applied during runtime...D3D11OK
  • Dynamically building a player object with sub-meshes works great...D3D11OK
  • Passing tab-delimited strings for multiple materials on an object( or terrain )works great...D3D11OK
  • Custom materials on CloudLayer works great...D3D11OK
  • GroundCover with shapes ONLY works...D3D11 partially OK

( The bad so far ) :
  • Same offset rectangle bug appeared when I used the 'metrics(fps)' console command. The rendered white rectangle in the fps display is offset and not contained within its border properly.
  • ***CRASH *** GroundCover crashes the application for me when I try to load or add groundcover textures. I'm not extremely savvy with shaders, but it should be easy enough to track down. Here's the log:

Code: Select all

failed to compile shader: C:\dev\DX11\Torque3D-development\My Projects\Test\game\shaders\procedural\5d52451f_V.hlsl(64,4): error X3017: 'foliageProcessVert': cannot implicitly convert from 'float2' to 'float4'


Still porting... :arrow:

Update:
  • DragControls across separate GUI's works great...D3D11OK
  • Player mounting weapons works great, even with dynamic lights or particles attached...D3D11OK

Update 2:
  • GuiObjectView custom skinning complete...D3D11OK

That's all for tonight! 2 of the 4 features are re-enabled now for the GuiObjectView, so before I run into the actual culprit problem I'm going to get some rest!
TorqueFan
Posts: 87
Joined: Thu Apr 30, 2015 5:35 am
by TorqueFan » Thu Apr 07, 2016 7:14 pm
Okay, pretty much the whole project is ported now.

GuiObjectView Fixed
I Fixed the GuiObjectView problem and found the culprit in a couple checks I added. I'm not entirely sure what changed behind the scenes to break it in the first place, but here are the details:

I use an enum to initialize a name index, like this:

Code: Select all

     enum blendAnimations{
        eyeScale0 = 0,
        eyeScale1 = 1,
        eyeScale2 = 2,
        eyeScale3 = 3,
        eyeScale4 = 4,
        totalBlendAnimations = 5
     };

     String mBlendSeqName[totalBlendAnimations];


The problem was I was calling...

Code: Select all

   if (!mBlendSeqName[mChosenEyeScale].isEmpty())

...where mChosenEyeScale is just the index value chosen through the GUI's. Oddly enough, these checks worked fine prior to the D3D11 merge. I Removed the checks, which to be completely honest seemed a tad redundant anyhow, and wham all is well. Using the example above, adjusting eye scale with a GUI slider is possible via blends!

/shrug - But hey, who cares?! I managed to fix my own problem, port the entire project over to D3D11, give a chunk of feedback, and spot a couple (potential) bugs.

I extended the GuiObjectView with 4 new features, so look forward to that being up on GH soonish.

When I get the time again to revisit this I will try to port over some custom sky rendering classes I've pieced together along the way to see how they go. Hey, thanks again for all the work on this!!
Timmy
Posts: 306
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Fri Apr 08, 2016 9:12 am
TorqueFan wrote:( The bad so far ) :
  • Same offset rectangle bug appeared when I used the 'metrics(fps)' console command. The rendered white rectangle in the fps display is offset and not contained within its border properly.
  • ***CRASH *** GroundCover crashes the application for me when I try to load or add groundcover textures. I'm not extremely savvy with shaders, but it should be easy enough to track down. Here's the log:

Code: Select all

failed to compile shader: C:\dev\DX11\Torque3D-development\My Projects\Test\game\shaders\procedural\5d52451f_V.hlsl(64,4): error X3017: 'foliageProcessVert': cannot implicitly convert from 'float2' to 'float4'




Cheers for the feedback.

Ok first offset problem, i can reproduce this one. It is the pixel offset that DX9 uses compared to both DX11/OpenGL. Will track it down.
The second problem i can't reproduce, could you perhaps try and reproduce this in stock T3D and if you can, would you mind posting the GroundCover code you used.
Timmy
Posts: 306
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Fri Apr 08, 2016 9:34 am
I have a fix for that pixel offset problem, will get that online asap. Yeah just let me know about that GroundCover @
User avatar
TorqueFan


*Edit

https://github.com/GarageGames/Torque3D/pull/1577
TorqueFan
Posts: 87
Joined: Thu Apr 30, 2015 5:35 am
by TorqueFan » Fri Apr 08, 2016 7:07 pm
Awesome, yep, drawRect() offset fix works great thanks!

GroundCover
Okay, here's what I found about GroundCover object. The problem I ran into deals with the material definition. In my case, I was adding a detailMap layer to the material. This was giving me a little more creative freedoms on how the material would ultimately look - BUT that was pre-D3D11. I've already noticed that some of my other materials that use detailMap layers look different than before this merge...but in a good way. So I need to update my art across the board a tad to fit D3D11( that's a good thing ).

Here's the problem:

Code: Select all

singleton Material(Mat_Grass)
{
   mapTo = "Grass_cover";
   ...
   detailScale[0] = "1 1";
   detailMap[0] = "art/environment/cover/Grass/Grass_d.png";
};

If I comment out the detailMap and detailScale here, there is no problem at all. If I don't comment that out, I get an error popup about 'can't compile shader'( same error as in the log I posted before ).

Now, I dug a little bit deeper around material definitions because D3D11 in Torque is too much win! I created a new GroundCover object( D3D11 build, Empty Terrain mission ) and then for the material I set it to the Lurker rifle's muzzle flash. Boom, same error as above. Now obviously the muzzle flash sequence was never meant to be a ground cover material, but a user could potentially want some other sort of animated ground cover material. I followed this procedure for several materials - some would work and others would not.

Ultimately I found that these variables did work fine in material definitions in any case :

Code: Select all

 
mapTo =
diffuseMap[0] =
diffuseColor[0] =
doubleSided =
translucentBlendOp =
alphaTest =
alphaRef =
materialTag0 =
normalMap[0] =
specular[0] =
specularPower[0] =
glow[0] =
emissive[0] =
useAnisotropic[0] =
castShadows =
castDynamicShadows =


These caused the crash :

Code: Select all

detailMap[0]
animFlags[0] =
scrollDir[0] =
rotSpeed[0] =
rotPivotOffset[0] =
waveFreq[0] =
waveAmp[0] =


I'm not sure which of the animation variables caused the problem, I just included all that were used in the muzzle flash sequence I tested.

Timmy wrote:Cheers for the feedback.

Cheers!
Timmy
Posts: 306
Joined: Thu Feb 05, 2015 3:20 am
by Timmy » Sat Apr 09, 2016 9:00 am
Check here, i will PR it once it is confirmed. https://github.com/rextimmy/Torque3D/tree/shadergenHLSL_foliage_fixes

I gotta say a lot of the detail map stuff with the grass is mostly pointless because it will kill the blending but it won't crash now.

*Edit:
my bad it doesn't kill the blending ;) anyway should work as expected now. Also with the difference you are seeing with your detail maps, this is because the textures are now linearized by default(appropriate ones anyway), this was brought in with deferred shading.
TorqueFan
Posts: 87
Joined: Thu Apr 30, 2015 5:35 am
by TorqueFan » Sun Apr 10, 2016 6:29 pm
Oh nice, thanks for looking into that. If not later this evening than on tomorrow I should be able to confirm.

Timmy wrote:Also with the difference you are seeing with your detail maps, this is because the textures are now linearized by default(appropriate ones anyway), this was brought in with deferred shading.

@
User avatar
Timmy
, could you help me to understand the 'normal' workflow used when importing detail textures now? Like prior to this, I'd either use a high pass filter or something very similar when creating a detail map for T3D. What do you describe as "appropriate" textures and how do I import my texture properly?

EDIT :
Confirmed the updates, thanks a lot. :D If not detail maps, surely something would have come up. All material definitions working great now!
  • 1
  • 3
  • 4
  • 5
  • 6
  • 7
64 posts Page 5 of 7

Who is online

Users browsing this forum: No registered users and 1 guest