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

Author Topic: PostFX, y u no work, but why?  (Read 3621 times)

0 Members and 1 Guest are viewing this topic.

ANtY

  • Newbie
  • *
  • Posts: 3
    • View Profile
PostFX, y u no work, but why?
« on: September 12, 2011, 11:12:37 pm »
I have some issues with postfx, it's running well on others' PCs but not on mine. There is a lot of stupid errors, not found variables, not found functions (like atan2) or "too many arguments in contructor" in line like this:
Code: [Select]
dist/=powe;

All this while the same code works on my friend's pc...

My graphics card is ATI Radeon HD 5670.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
PostFX, y u no work, but why?
« Reply #1 on: September 13, 2011, 07:58:25 am »
Can you show your complete shader code? Have you tried the "PostFx" sample from the SFML SDK?
Laurent Gomila - SFML developer

ANtY93

  • Newbie
  • *
  • Posts: 6
    • View Profile
PostFX, y u no work, but why?
« Reply #2 on: September 13, 2011, 02:57:57 pm »
I knew you'll say something like this
Code: [Select]
texture frame
vec2 center
float powe

effect
{
vec4 px=frame(_in);
  float dist=distance(_in,center);
dist*=1000;
dist/=powe;
  _out=vec4(px/(dist<1?sqrt(sqrt(dist)):dist),1);
}



But that's not what I asked, problem is that it's working on other PC's, but not on mine.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
PostFX, y u no work, but why?
« Reply #3 on: September 13, 2011, 03:12:38 pm »
This is most likely a driver problem. That's why you should first test the official PostFx example, which is known to work.
Laurent Gomila - SFML developer

ANtY93

  • Newbie
  • *
  • Posts: 6
    • View Profile
PostFX, y u no work, but why?
« Reply #4 on: September 13, 2011, 03:47:26 pm »
It works

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
PostFX, y u no work, but why?
« Reply #5 on: September 13, 2011, 04:09:39 pm »
Ok, so it's your shader which contains instructions that are not supported by your driver.

Can you show us the list of errors that you get?
Laurent Gomila - SFML developer

ANtY93

  • Newbie
  • *
  • Posts: 6
    • View Profile
PostFX, y u no work, but why?
« Reply #6 on: September 13, 2011, 05:48:21 pm »
too many arguments contructor - for / operator,
Texture: not found "framebuffer" in post-effect - even when I use it in shader
Parameter: not found "radius" in post-effect - same
error(#202) No matching overloaded function found atan2

etc.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
PostFX, y u no work, but why?
« Reply #7 on: September 13, 2011, 09:59:40 pm »
Quote
too many arguments contructor - for / operator,
Texture: not found "framebuffer" in post-effect - even when I use it in shader
Parameter: not found "radius" in post-effect - same
error(#202) No matching overloaded function found atan2

Is there anything which relates to the shader that you posted? I see no "framebuffer" or "radius" variables, and no call to atan2.
And don't you have the corresponding lines of code?
Laurent Gomila - SFML developer

ANtY93

  • Newbie
  • *
  • Posts: 6
    • View Profile
PostFX, y u no work, but why?
« Reply #8 on: September 13, 2011, 11:27:12 pm »
In this which I posted only this shows:
error(#202) No matching overloaded function found atan2

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
PostFX, y u no work, but why?
« Reply #9 on: September 14, 2011, 07:45:45 am »
Quote
error(#202) No matching overloaded function found atan2

atan2 is not standard in GLSL, try atan instead (it has a version which takes 2 arguments too).

But I still can't find your call to atan2 in the shader you posted. Am I blind?
Laurent Gomila - SFML developer

ANtY

  • Newbie
  • *
  • Posts: 3
    • View Profile
PostFX, y u no work, but why?
« Reply #10 on: September 14, 2011, 08:16:14 am »
Sorry, wrong line, I meant this:
too many arguments contructor

Also, hmm I used atan but my friend's using atan2 and it's working on his PC. Also I'll past other shader which I triend and which caused these errors which I mentioned before when I get home.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
PostFX, y u no work, but why?
« Reply #11 on: September 14, 2011, 08:37:06 am »
Quote
Sorry, wrong line, I meant this:
too many arguments contructor

Can't you just copy and paste the shader and the exact error output from the GLSL compiler? ;)

Quote
Also, hmm I used atan but my friend's using atan2 and it's working on his PC

Different OpenGL drivers implement different GLSL instructions sets (I don't know if they are non-standard extensions, or rather just newer versions of GLSL).
So you should limit yourself to the most standard/basic/official set of instructions if you want maximum portability.
Laurent Gomila - SFML developer

 

anything