Shaders and setColor
Posted: Fri May 19, 2023 10:59 pm
I am learning shaders right now and I have a shader doing what I want for the most part (just diffusing a color). I had a single pixel have its color reset to full red with:
Nothing special there, or so I thought. I wanted to see how it interacted with a line of color, so I did this when first making the canvas:
The blue line was always disappearing though. I did a lot of experimenting to find why it was disappearing and what I found is that setColor was acting to multiply the colors the shader returned by what setColor was set to. Or to be more clear, if the shader returned red at 0.5 and I had used setColor to setColor(0.5,0.5,0.5,1), the red would be 0.25.
Is this interaction intended?
Code: Select all
love.graphics.setColor(1,0,0,1)
love.graphics.circle("fill",rx,ry,1)
Code: Select all
love.graphics.setColor(0,0,1,1)
love.graphics.rectangle("fill",4,0,1,64)
Is this interaction intended?