Archive 17/01/2023.

Metallic materials without PBR

1vanK

It used spec map as reflection map


In litsolid.glsl replace all

#ifdef ENVCUBEMAP finalColor += cMatEnvMapColor * textureCube(sEnvCubeMap, reflect(vReflectionVec, normal)).rgb; #endif
to

        #ifdef ENVCUBEMAP
            finalColor += cMatEnvMapColor * textureCube(sEnvCubeMap, reflect(vReflectionVec, normal)).rgb * specColor * cAmbientColor;
        #endif

Example technique (just add ENVCUBEMAP and SPECMAP everywhere, also technique should be without litbase pass)

<technique vs="LitSolid" ps="LitSolid" psdefines="DIFFMAP"> <pass name="base" vsdefines="NORMALMAP ENVCUBEMAP SPECMAP" psdefines="ENVCUBEMAP AMBIENT NORMALMAP SPECMAP"/> <pass name="light" vsdefines="NORMALMAP ENVCUBEMAP SPECMAP" psdefines="ENVCUBEMAP NORMALMAP SPECMAP" depthtest="equal" depthwrite="false" blend="add" /> <pass name="depth" vs="Depth" ps="Depth" /> <pass name="shadow" vs="Shadow" ps="Shadow" /> </technique>

Example material:

<?xml version="1.0"?> <material> <technique name="Techniques/MyDiffNormalSpecEnvCube.xml" /> <texture unit="diffuse" name="Textures/Cerberus_A.tga" /> <texture unit="normal" name="Textures/Cerberus_N.tga" /> <texture unit="environment" name="Textures/Skybox.xml" /> <texture unit="specular" name="Textures/Cerberus_A.tga" /> <parameter name="MatDiffColor" value="1 1 1 1" /> <parameter name="MatSpecColor" value="1 1 1 100" /> <parameter name="MatEnvMapColor" value="1 1 1 1" /> </material>

dragonCASTjosh

Nice work, i will not that the IBL looks to have the same problem PBR had when i picked it up from sinoid where the reflections look greasy, to solve this you have to change the way reflections are rendered. In addition to this Metallic in a real work senario do you accept diffuse, the more metallic the less diffuse. I believe your results are what developers did before the mainstream of PBR within modern engines.