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

Author Topic: Shaders for a specific sprite?  (Read 1806 times)

0 Members and 1 Guest are viewing this topic.

Drak

  • Newbie
  • *
  • Posts: 8
    • View Profile
Shaders for a specific sprite?
« on: June 08, 2011, 02:11:30 am »
I don't know much about GLSL - but how would I go about making a shader only effect one sprite, instead of the whole scene? Without having to draw  the sprites after the shader? Or is that the only way?
Thanks.

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Shaders for a specific sprite?
« Reply #1 on: June 08, 2011, 05:05:24 am »
Are you using SFML 1.x? In SFML2, the only way you can use shaders is on a sprite or other drawable. I'm not sure how in SFML 1.x.
I use the latest build of SFML2

Drak

  • Newbie
  • *
  • Posts: 8
    • View Profile
Shaders for a specific sprite?
« Reply #2 on: June 08, 2011, 05:52:02 am »
Quote from: "OniLink10"
Are you using SFML 1.x? In SFML2, the only way you can use shaders is on a sprite or other drawable. I'm not sure how in SFML 1.x.

1.6 - Just using the standard PostFX class. There is the SetTexture() command, not sure how it functions though.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Shaders for a specific sprite?
« Reply #3 on: June 08, 2011, 07:43:11 am »
You can't do it in SFML 1.6 -- that's why the class is named PostFx and not Shader ;)
Laurent Gomila - SFML developer