Dynamically updating textures -- possible?

Archive of the old editing forum
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. This forum is archived - please use this set of forums to ask new questions.
Gez
 
 
Posts: 17637
Joined: Fri Jul 06, 2007 3:22 pm

Dynamically updating textures -- possible?

Post by Gez »

As far as I understand the GLDEFS shaders, they're read-only, in that they can't update the source image. I'd like to (try to) make something that continually updates a texture, something like say, Conway's game of life. Is it possible?

If not with shaders, is it possible with ZScript?
User avatar
Rachael
Admin
Posts: 12907
Joined: Tue Jan 13, 2004 1:31 pm
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Preferred Pronouns: She/Her

Re: Dynamically updating textures -- possible?

Post by Rachael »

This will likely require being able to give fragment shaders write access to a texture, directly.

I would wait until Vulkan support is more mature - Graf has made it clear that he wants to wait to do more generalized shader improvements until then.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 47994
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Dynamically updating textures -- possible?

Post by Graf Zahl »

Writing to a texture with a shader is certainly possible - but it's not this simple. It will require a similar setup like the camera textures or the postprocessing effects that set up a texture as a render target.
The input textures to a shader are immutable objects and cannot be modified.

This also needs to run outside of the main shader, of course.

Return to “Editing (Archive)”