Welcome, Guest.
Username: Password: Remember me

TOPIC: share functions/textures/samplers between shaders

share functions/textures/samplers between shaders 2 weeks 2 days ago #1

  • moriz1
  • moriz1's Avatar
  • Offline
  • Posts: 72
  • Thank you received: 31
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 2 weeks 1 day ago #2

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 3003
  • Thank you received: 1755
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 2 weeks 1 day ago #3

  • moriz1
  • moriz1's Avatar
  • Offline
  • Posts: 72
  • Thank you received: 31
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 2 weeks 21 hours ago #4

  • crosire
  • crosire's Avatar
  • Offline
  • Posts: 3003
  • Thank you received: 1755
No.
Cheers, crosire =)
The administrator has disabled public write access.