0

I dived successfully into DirectX/3D11 (SharpDX/C#), I brought everything to life and finally, I wanted to implement PBR. I highly wanted the one-and-only BRDF like Disney / Burley, and luckily I've found the Microsoft Shipped PBREffect.fx in the Shader folder, an HLSL Shader for exactly my goal.

Finally, all my constant buffers are delivering, PBR itself working fine - but in a bigger scene, the only light I succeeded to apply lights up very small, like specular points and everything else keeps dark. For example, on the solarpanel texture the ALBEDO is not visible at all without the spacular light corona on it. Roughness, AO, Normal is all the time applied, because I have the ambient occlusion lights white lines visible and this is coming from the other maps.

And I am in some kind of out of possibilities. I cannot implement other Light solutions, because this would brick or override the whole PBR thing. Total different implementations through all the functions.

Does someone have some experience with this shader and an idea, how to get a "WORLD Light", that I have a base brightness on all objects also in Bis scenes. Like 1000.0f and up as rendering space.

Stephan.

3 Screenshots attached.

[The maps/PBR are perfectly applied but only in the spotlight] https://i.stack.imgur.com/JeUH3.jpg [Brass PBR material - only lit up on the spot] https://i.stack.imgur.com/KZNK7.png [image1]https://i.stack.imgur.com/Unmvm.jpg

Peter O.
  • 32,158
  • 14
  • 82
  • 96

1 Answers1

0

Update: I've found the reason. The Shader is built for using a Radiance Texture and a Irradiance Texture. I've never used with PBR and simply ignored slot 6 and 7. I assumed that it will be ignored, I already tried to comment the part out, but nothing changed. This time i've edited Irrad./Rad. part and i - at least got standard "ambient" Lighting back. I still need to find some active lights that not only light up a little spot. Because PBR as well as normals cannot work with Ambient, pretty normal, but for now, the darkness is gone.. For Thread purposes, here are the lines for the radiance/irr.:

first, there are 2 functions for Sub-Calculations:

float3 Diffuse_IBL(in float3 N)
{
    //return IrradianceTexture.Sample(IBLSampler, N);
    return float3(1.0f, 1.0f, 1.0f) * 0.9f;  // here i send a color + an intensity val
                                             // this brought back the ambient..
}

// Approximate specular image based lighting by sampling radiance map at lower mips 
// according to roughness, then modulating by Fresnel term. 
float3 Specular_IBL(in float3 N, in float3 V, in float lodBias)
{
    float mip = lodBias * NumRadianceMipLevels;
    float3 dir = reflect(-V, N);
    //return RadianceTexture.SampleLevel(IBLSampler, dir, mip);
    return float3(1.0f, 1.0f, 1.0f)*lodBias; // just playing around - not valuable :)
}

And these functions are called at the end of the "LightSurface", the main function that " Apply Disney-style physically based rendering to a surface ", the affected rows are:

// Add diffuse irradiance
float3 diffuse_env = Diffuse_IBL(N);
acc_color += c_diff * diffuse_env;

// Add specular radiance 
float3 specular_env = Specular_IBL(N, V, roughness);
acc_color += c_spec * specular_env;

return acc_color;

if someone is interested in having a try, it follows the only "professional-market" accepted PBR approach, the "roughness-metalness-Workflow". Don't be confused by "specular" in the code, it's not just specular, it's much more around.. the "Standard"-Specular or Glossiness should not be used, these workflows are just "shiny" or sth. The Shader is called "PBREffect.fx" + it's includes and can be found inside the "DirectXTK" available on GitHub for example.

  • Note that for the DirectX Tool Kit implementation, we use Image-Based Lighting which was intended to give a nice look for basic scenes, but may not be the right solution for all engines. See the references on the [wiki](https://github.com/microsoft/DirectXTK/wiki/PBREffect#further-reading) – Chuck Walbourn Feb 23 '20 at 20:07
  • Okay, thank you. I dived into Direct3D from Scratch, using SharpDX and was happy to accidently find this shader, independent to C++/C# - cause i write in C#.. so i'll try to find a material/Object based Shader w/o raddiance/irr.. – Stephan Ertel Mar 14 '20 at 03:23
  • Or maybe i have enough paper now to put everything together.. A One-Cline PBR-Model/MaterialViewer would be great if you do 3D-modelling for Flight-Simulator (Prepar3D + maybe the new one by MS)... It's really annoying to get a view of the PBR game result.. put 3 texture layers into one, create a model, material and apply, export and run the Simulator... My current approach is: Apply one texture of the layers as "Diffuse" - and run my viewer.. I just take the path of the "diffuse" layer and find all (properly named) maps.. no "PBR" - 3D Format needed, i love it, so easy.. – Stephan Ertel Mar 14 '20 at 03:37