Jump to content
  • Advertisement
Sign in to follow this  
Wrathnut

SFML shaders

This topic is 2594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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);

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!