### PBR: Principles, Practice, and Prepwork

Materials, textures, lighting, postfx

#### Re: PBR: Principles, Practice, and Prepwork

Mud-H
Posts: 175
Joined: Thu Feb 19, 2015 3:08 pm
I'm having an issue with my terrain texture blending, I don't know exactly when it have appeared but I have test on a fresh code base and it appear right after I add the PBR branch to my code. I think it might be from the latest changes in PBR branch or T3D Development branch. (But T3D development without the PBR code added blend the terrain textures fine...)
Here's a screenshot of what's happening:

You have any idea what's causing it and if it's related to the PBR code? Maybe I forgot a needed script change...

Edit: I only need to add the PBR branch, right? What are the PBR_LightProbeLights , PBR_LPV and pbr_lpv_wteness_bbq branches?

Edit2: Ok, It seem to not be related to the PBR code directly, I have compiled the PBR branch alone and blending is working fine. I need to figure where I messed up...

Edit3: I wrote to fast, the issue is there when I load an example terrain from http://www.torqueterrains.com/ .So should be related to something in the material or mission file.

Edit4: I think I have track down where the blending issue come from: https://github.com/Azaezel/Torque3D/com ... 8f7e0a20e7
The commit just before that have terrain blending working fine, but from this commit and after, it's not. I have been playing a lot with terrain materials on the Stock PBR template and it's hard to understand what's wrong... Seem like it's related to the order of the materials in some way...

Edit5: I have found what is causing the issue in that commit, I have rollback the following change and it works fine now I really don't know what it does, I guess you'll have a better understanding of the reason I had terrain blending problem... Do it happen for everyone or just few?

Code: Select all

-   Var *color = NULL;-   if (fd.features[MFT_isDeferred])-       color = (Var*) LangElement::find( getOutputTargetVarName(ShaderFeature::RenderTarget1) );-   else-       color = (Var*) LangElement::find( getOutputTargetVarName(ShaderFeature::DefaultTarget) );+   Var *color = (Var*) LangElement::find( getOutputTargetVarName(ShaderFeature::DefaultTarget) );

#### Re: PBR: Principles, Practice, and Prepwork

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

translation:

Code: Select all

If we've added the deferred flag-feature (we're using what was the prepass class)output color to the second (color) buffer for recombination laterelseoutput color to the standard buffer

put that back to stock for a bit to see if that'd mitigate the normal-with-hieghtmap-data blending problem mentioned upthread. will have to cook up a better solution, clearly.

#### Re: PBR: Principles, Practice, and Prepwork

Mud-H
Posts: 175
Joined: Thu Feb 19, 2015 3:08 pm
Thanks for the translation but it doesn't make me understand much more. The rendering stuff and language is in my "Things to learn someday" list... I don't even know what Deferred rendering mean... (And don't bother to explain, I will get to it one day).

Keep up your good work, it's really appreciated when you don't understand rendering process (Normal with heightmap data would be a nice addition to T3D )

#### Re: PBR: Principles, Practice, and Prepwork

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

Mud-H wrote: (Normal with heightmap data would be a nice addition to T3D )

It's there stock. Parallax slider + alpha of the normalmap. If it wasn't, I wouldn't be so concerned with trying to circle back and fix it, since folks wouldn't miss what they don't have nearly as much.

That being said, to cut down on things to wade through specifically related to PBR (and to fullfill at least par of the whole 'and prepwork' portion of the thread tag), viewtopic.php?f=9&t=387 will be one of the first subsystem extracts tossed over as soon as The Last Bug Dies.

#### Re: PBR: Principles, Practice, and Prepwork

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

Kinda stalled out on the query thing, so took a breather and started comparing deferred to the upcomming dx11 work.

One of the nastier conflict-points was the linearization step, so rewrote that for clarity. Now defines a toLinear and toGamma method that runs after texture loading for diffuses/albedos, instead of taking it's place in shadergen (and water).

Also cooked up a substance converter for the solider (still wip, but should give folks ideas), and cleaned up that fouled stone material. (Also rolled in the two submitted forks from the above thread)

https://youtu.be/8wfSC_Neq3U

#### Re: PBR: Principles, Practice, and Prepwork

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

linearization turned over https://github.com/GarageGames/Torque3D/pull/1461
there will be conflicts once that's rolled in to head. will resolve those as the issue arises.

also fixed the accumulation textures: http://imgur.com/a/K39yq

in addition, working with timmy to roll in dx11 https://github.com/Azaezel/Torque3D/tree/PBRDX11 cleaned up findings will be backported to the main working branch.

#### Re: PBR: Principles, Practice, and Prepwork

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

Added a further demonstration/assistance model for artists that are unfamiliar with the system:

Smoothness is X, metalness is Y.

Edit: forgot AO:

#### Re: PBR: Principles, Practice, and Prepwork

J0linar
Posts: 45
Joined: Thu Feb 05, 2015 8:50 pm
Starts to shape up pretty, might have to test this
...

#### Re: PBR: Principles, Practice, and Prepwork

Chelaru
Posts: 182
Joined: Wed Jul 01, 2015 10:33 am
Azaezel wrote:Added a further demonstration/assistance model for artists that are unfamiliar with the system:

Smoothness is X, metalness is Y.

Edit: forgot AO:

To be sincere it look like a work in progress. I mean is PBR it should look ~like in the real world.

#### Re: PBR: Principles, Practice, and Prepwork

JeffR
Steering Committee
Posts: 682
Joined: Tue Feb 03, 2015 9:49 pm

@
Chelaru

Can you clarify what looks WIP? Do you not like the demo model? Or does the PBR look incorrect to you?

#### Who is online

Users browsing this forum: No registered users and 1 guest