Trying to write shaders in game maker for a thing.... does anyone know the best way to look at what's currently on the screen from a shader?
i.e, I want to replace a color on the screen with something else after it's been rendered
-
-
the color for the whole screen or just one draw?
-
I want to replace a color across the whoooooole screen
- Antwoorden weergeven
Nieuw gesprek -
-
-
As far as I recall, it's best to draw everything to a surface, then apply your shader to that surface when you draw it to the screen.
-
yea, realizing what I wanted to do isn't really a thing... figuring it out
Einde van gesprek
Nieuw gesprek -
-
-
I haven't used shaders in a while, but this should do what you want; if(fragcolor.r > x) && (fragcolor.r < y) { fragcolor.r = z; }
-
Using an "if" feels bad, but I'm not sure of a cleaner way to do it. It's a range rather than one value because of floating point reasons.
Einde van gesprek
Nieuw gesprek -
-
-
You would have to go through another render (called post-process). Not sure how to do it in GM, but in OpenGL you render to a separate [1/2]
-
FrameBuffer, then render that buffer to the display FrameBuffer. Now you can have a shader that knows the result from the whole draw [2/2]
- Antwoorden weergeven
Nieuw gesprek -
Het laden lijkt wat langer te duren.
Twitter is mogelijk overbelast of ondervindt een tijdelijke onderbreking. Probeer het opnieuw of bekijk de Twitter-status voor meer informatie.