External texture support for texture shaders

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: External texture support for texture shaders

Re: External texture support for texture shaders

by Diode » Sat Jul 21, 2018 2:21 pm

It looks like there's progress on this on github. Is this slated for the next version?

Re: External texture support for texture shaders

by Talon1024 » Sun Jul 08, 2018 1:23 pm

Is this the kind of thing that would make this effect possible in GZDoom? That would be really awesome.

Re: External texture support for texture shaders

by Pixel Eater » Thu Jul 05, 2018 7:21 am

Thanks UsenameAK!

I'll be using this for making alpha maps :)

Re: External texture support for texture shaders

by UsernameAK » Thu Jul 05, 2018 6:49 am

Re: External texture support for texture shaders

by Pixel Eater » Thu Jun 14, 2018 9:31 pm

Dangit! I literally just ran into this problem :tongue:

Re: External texture support for texture shaders

by Graf Zahl » Thu Jun 14, 2018 9:27 am

Not before Vulkan is working.

Re: External texture support for texture shaders

by Major Cooke » Thu Jun 14, 2018 8:39 am

This would also be greatly appreciated for models.

Re: External texture support for texture shaders

by Marisa the Magician » Thu Feb 22, 2018 5:09 pm

I'll try to figure out how. I haven't really touched graphics-related gzdoom code yet.

Edit: What have I gotten into...

Re: External texture support for texture shaders

by dpJudas » Thu Feb 22, 2018 4:47 pm

With a reply like that I guess you'll have to file the PR yourself..

Re: External texture support for texture shaders

by Marisa the Magician » Thu Feb 22, 2018 4:36 pm

TBH I only wanted these for the diffuse...

Re: External texture support for texture shaders

by dpJudas » Thu Feb 22, 2018 7:16 am

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.

External texture support for texture shaders

by Marisa the Magician » Thu Feb 22, 2018 6:20 am

We already have this for screen shaders and it's all good, but I've been thinking that this could also get some use on texture shaders. Overlays, distortions, all sorts of stuff.

Top