You will probably not see any improvements in this area until after the materials branch.
User shaders for materials are complicated. The light code needs to cooperate with the output of the shader. For example, if you want to use a brightmap, the shader needs to output both the primary texture color and the emissive color.
The current internal brightmap shader looks like this:
Code: Select all
vec4 ProcessTexel()
{
return getTexel(vTexCoord.st);
}
vec4 ProcessLight(vec4 color)
{
vec4 brightpix = desaturate(texture(texture2, vTexCoord.st));
return vec4(min (color.rgb + brightpix.rgb, 1.0), color.a);
}
As you can see, there's two outputs. ProcessTexel and ProcessLight. For a material with a normal map and specular there's need for an additional ProcessNormal and ProcessSpecular. For PBR there's ProcessRoughness and ProcessMetallic. All of this needs to be set up in GLDEFS so that GZDoom knows what kind of output is implemented in the shader.
That in turn affects texture binding as each of those needs a place to sample from. Should that always be custom textures for custom shaders? There's a bunch of stuff like this that needs to be thought through. A premature quick fix for the current hardware shaders will only cause cursing down the road.
TL;DR: Don't expect to get this feature for some time. It isn't as simple to add as for the screen shaders.
You will probably not see any improvements in this area until after the materials branch.
User shaders for materials are complicated. The light code needs to cooperate with the output of the shader. For example, if you want to use a brightmap, the shader needs to output both the primary texture color and the emissive color.
The current internal brightmap shader looks like this:
[code]
vec4 ProcessTexel()
{
return getTexel(vTexCoord.st);
}
vec4 ProcessLight(vec4 color)
{
vec4 brightpix = desaturate(texture(texture2, vTexCoord.st));
return vec4(min (color.rgb + brightpix.rgb, 1.0), color.a);
}
[/code]
As you can see, there's two outputs. ProcessTexel and ProcessLight. For a material with a normal map and specular there's need for an additional ProcessNormal and ProcessSpecular. For PBR there's ProcessRoughness and ProcessMetallic. All of this needs to be set up in GLDEFS so that GZDoom knows what kind of output is implemented in the shader.
That in turn affects texture binding as each of those needs a place to sample from. Should that always be custom textures for custom shaders? There's a bunch of stuff like this that needs to be thought through. A premature quick fix for the current hardware shaders will only cause cursing down the road.
TL;DR: Don't expect to get this feature for some time. It isn't as simple to add as for the screen shaders.