Welcome, Guest.
Username: Password: Remember me

TOPIC: share functions/textures/samplers between shaders

share functions/textures/samplers between shaders 7 months 1 week ago #1

i vaguely remember reading somewhere that it is possible to share functions/textures/samplers between shader effects. if this is possible, what's the syntax to get it to work?

reason i'm asking, is because i've written two shaders with the same luma adaptation effects. if i run both shaders, i suspect the two adaptation effects will intefere with each other.
The administrator has disabled public write access.

share functions/textures/samplers between shaders 7 months 1 week ago #2

Textures are shared. As long as they have the same name in both effects, they access the same memory. Anything else is not shared, though name clashes are between effects are undefined behavior. How you access a texture (that is, with which sampler or render target) is irrelevant.
Cheers, crosire =)
The administrator has disabled public write access.

share functions/textures/samplers between shaders 7 months 1 week ago #3

is there a way to check if a texture has already been instantiated in another shader?
The administrator has disabled public write access.

share functions/textures/samplers between shaders 7 months 1 week ago #4

No.
Cheers, crosire =)
The administrator has disabled public write access.