I’m trying to implement physically based shading for Urho3d and its deferred shader.
Physically based shading uses the Cook Torrance shading model. I’m implementing Epic’s Model
This is a log.
Material textures required:
Base Color (RGB):
Roughness (Greyscale):
Metallic (Greyscale):
if metallic == 1.0 (White) (is metal)
specular = albedbo
else if metallic == 0.0 (Black) (is dialect)
diffuse = albedo
fixed reflectance value (linear: 0.04 sRGB: 0.06)
else
reflectivity from albedo
diffuse = albedo * metallic
Cavity (Greyscale):
s.diffuseLight *= cav *diffuseCavityStrength
s.specularLight *= cav * specularCavityStrength
Normal Map:
Use Urho’s xGxR.
Shaders are in Bin\CoreData\Shaders.
ShaderVariation* Graphics::GetShader(ShaderType type, const char* name, const char* defines) const;
DeferredLight.glsl is deferred lighting.
Can someone explain how the shaders in Urho3d work?