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

Author Topic: New Shader class in SFML 2 to replace PostFx  (Read 30953 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32502
    • View Profile
    • SFML's website
    • Email
An
« Reply #60 on: December 03, 2009, 07:48:52 pm »
Quote
I thought the problem wasn't fisheye, but globalShader

It is fisheye with globalShader ;)

Quote
Is it because you are using a RenderImage?

Yes, the internal texture of a render-image is flipped compared to a regular image. And the effect doesn't take that in account.
Laurent Gomila - SFML developer

bonbonizer69

  • Newbie
  • *
  • Posts: 1
    • Yahoo Instant Messenger - pj_peterpj@yahoo.com
    • View Profile
Re: An
« Reply #61 on: December 17, 2009, 03:58:49 am »
Quote from: "Laurent"

Yes, the internal texture of a render-image is flipped compared to a regular image. And the effect doesn't take that in account.


Exactly.

panithadrum

  • Sr. Member
  • ****
  • Posts: 304
    • View Profile
    • Skyrpex@Github
    • Email
Re: An
« Reply #62 on: December 17, 2009, 01:59:48 pm »
Quote from: "Laurent"
Quote
I thought the problem wasn't fisheye, but globalShader

It is fisheye with globalShader ;)

Quote
Is it because you are using a RenderImage?

Yes, the internal texture of a render-image is flipped compared to a regular image. And the effect doesn't take that in account.


May I ask why? Some sort of optimization?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32502
    • View Profile
    • SFML's website
    • Email
New Shader class in SFML 2 to replace PostFx
« Reply #63 on: December 17, 2009, 02:14:29 pm »
No, it's just the way OpenGL draws to a render-texture. Actually, it forces me to add some ugly hacks to handle it.
Laurent Gomila - SFML developer

klusark

  • Newbie
  • *
  • Posts: 45
    • View Profile
New Shader class in SFML 2 to replace PostFx
« Reply #64 on: February 11, 2010, 03:07:23 am »
Whenever I try to use sf::Shader::CurrentTexture it does not link telling me "unresolved external symbol "public: static class sf::Image const sf::Shader::CurrentTexture"". This also happens in the Shader example. I have linked sfml-graphics.lib and other graphics do work fine. I am using SFML2 revision 1399.
Thanks.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32502
    • View Profile
    • SFML's website
    • Email
New Shader class in SFML 2 to replace PostFx
« Reply #65 on: February 11, 2010, 08:05:35 am »
You forgot to define SFML_DYNAMIC.
Laurent Gomila - SFML developer

heishe

  • Full Member
  • ***
  • Posts: 121
    • View Profile
New Shader class in SFML 2 to replace PostFx
« Reply #66 on: November 17, 2010, 09:31:13 pm »
why did you remove the preprocessing step? seem very odd. what you had in there was a very clean, very easy to use version of the GLSL shader language.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32502
    • View Profile
    • SFML's website
    • Email
New Shader class in SFML 2 to replace PostFx
« Reply #67 on: November 17, 2010, 10:25:03 pm »
Basically, people had to learn GLSL and then unlearn a few things and replace them with SFML specific stuff. I find it more natural to use plain GLSL.
Laurent Gomila - SFML developer

heishe

  • Full Member
  • ***
  • Posts: 121
    • View Profile
New Shader class in SFML 2 to replace PostFx
« Reply #68 on: November 18, 2010, 09:55:43 am »
Quote from: "Laurent"
Basically, people had to learn GLSL and then unlearn a few things and replace them with SFML specific stuff. I find it more natural to use plain GLSL.


Mhm, yeah that is true I guess. I remember getting confused with the GLSL syntax a few times when I started using it together with the "sfmlglsl".

But without all the gl_Whatever stuff in the shader files it just seemed way more streamlined with the rest of SFML to me.

Maybe a solution would be to write a more detailed tutorial about pixel shaders in general?

I know it would cost you time, but you wouldn't have to go into syntax specific things like "put a ; after every statement". You'd just have to tell people: This is how you address pixels of a texture, this is how you manipulate it's color, and this is how you put it out to the screen. And maybe something like: "A pixel shader does that, and it works like this" etc.

Or you could somehow provide us with the preprocessing code so we can include it in our code ourselves?

But whatever, it isn't too big of a deal I guess. It's one of the few (if not only) 2D libraries where we even get to use pixel shaders so I'm happy :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32502
    • View Profile
    • SFML's website
    • Email
New Shader class in SFML 2 to replace PostFx
« Reply #69 on: November 18, 2010, 11:35:45 am »
Quote
I know it would cost you time, but you wouldn't have to go into syntax specific things like "put a ; after every statement". You'd just have to tell people: This is how you address pixels of a texture, this is how you manipulate it's color, and this is how you put it out to the screen. And maybe something like: "A pixel shader does that, and it works like this" etc.

It's even simpler with the current design: "read any GLSL tutorial and you're ready to use sf::Shader".

Quote
Or you could somehow provide us with the preprocessing code so we can include it in our code ourselves?

You're free to implement a different shader syntax and the proprocessor that goes with it. You can pick the code in sf::PostFx and base your implementation on that.
Laurent Gomila - SFML developer

 

anything