Advertisement

SFML shaders

Started by November 01, 2011 11:02 PM
1 comment, last by Wrathnut 13 years, 4 months ago
I posted this in the SFML graphics forums but didn't get any response. Not even ,"pixel shaders; you're doing it wrong!"

Anyway I was playing with SFML 1.6 to evaluate it for my next project and tried to modify the tutorial they put together. That seemed to work so my next step was to try to make a flashlight that followed the mouse. My first idea was to try to shade the entire screen to black using the pixel shader but the following code appears to do nothing.


effect
{
vec3 darkcolor(0.0, 0.0, 0.0);
_out = vec4(darkcolor, 1.0);
}


Any ideas on why this simple shader doesn't work would be greatly appreciated!

Thanks,

Wrath
IIRC, SFML shaders are a wrapper for GLSL shaders. So your line:

vec3 darkcolor(0.0, 0.0, 0.0);

Isn't valid GLSL. It should be:

vec3 darkcolor = vec3 (0.0, 0.0, 0.0);
Advertisement
Xycaleth,

Thanks! That did it. Looks like I need learn more about GLSL shaders.

This topic is closed to new replies.

Advertisement