Is it possible to draw a textured quad on the screen with values that can be interpreted as two’s complement (e.g. -128…+127) and have the destination (framebuffer or texture) changed accordingly?
Perhaps if I render to a texture with a special format?
Rendering twice is really not an option, I’m afraid.
you could grab the framebuffer into a texture A
and when you draw your quad, map it such a fashion that the texcoords match the viewport.
without using shaders you can do this using texgen.
so your quad uses
A: texgen, framebuffer tex
B: tescoords, your special tex
with arb_texture_env_combine extension you can perform the operation “ADD_SIGNED”, which will do what you asked for.
Unfortunately I am using vertex and fragment shaders. In fact the particles need to be written many times over the same places. Thus I can’t afford copying the framebuffer to a texture each time
But I will try to render to a texture instead. Perhaps a float or signed_int can do the job?!