Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Shader is not drawn of the current shape.  (Read 1176 times)

0 Members and 2 Guests are viewing this topic.

alex1997

  • Newbie
  • *
  • Posts: 1
    • View Profile
Shader is not drawn of the current shape.
« on: December 04, 2017, 05:48:36 pm »
Hey, I've decided to use SFML for my next project because of it's great API and so far so good until playing with shaders. What I'm looking to do and couldn't figure it out ( I suspect it might be because of gl_Position) is to apply shaders to their current shape and not relative to the window... Below you can see the shader.

http://thebookofshaders.com/edit.php?log=171204164930

I've got for testing a rectangle shape with offset(x, y) and size(w, h), but the shader's canvas seems to be the window rather than the actual shape(u_resolution uniform is set too Vector2f(winW/2, winH/2))..Any help would be appreciated, thanks!

 

anything