Welcome,
Guest
. Please
login
or
register
. Did you miss your
activation email?
French forum
Home
Help
Search
Login
Register
SFML community forums
»
Help
»
Graphics
»
Shader issue with Color transparency
Print
Pages: [
1
]
Author
Topic: Shader issue with Color transparency (Read 1496 times)
0 Members and 1 Guest are viewing this topic.
Msonic
Newbie
Posts: 2
Shader issue with Color transparency
«
on:
November 16, 2013, 07:46:49 am »
Hi,
I'm having some trouble with shaders and colors. See my
StackOverflow question
Basically, when I have a fragment shader active, the Color field the object is not taken in consideration. I don't really know why.
I haven't found anything similar on the forum.
Any help is greatly appreciated!
Logged
fallahn
Hero Member
Posts: 507
Buns.
Re: Shader issue with Color transparency
«
Reply #1 on:
November 16, 2013, 08:32:58 am »
When you use sprite.setColor() sfml is actually setting the vertex colours of the sprite. If you read the
shader tutorial
you'll find that by default the vertex colours are passed straight through and are available in fragment shaders via gl_Color. So in your case the transparency value can be found in gl_Color.a
«
Last Edit: November 16, 2013, 08:40:57 am by fallahn
»
Logged
Twitter
Super Video Golf
Tiled Map loader
Msonic
Newbie
Posts: 2
Re: Shader issue with Color transparency
«
Reply #2 on:
November 18, 2013, 05:11:23 pm »
Hmmm, I see. I'll try this when I get back home.
Thanks for the quick reply!
Logged
Print
Pages: [
1
]
SFML community forums
»
Help
»
Graphics
»
Shader issue with Color transparency