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

Author Topic: VertexArray and transparent texture  (Read 2345 times)

0 Members and 1 Guest are viewing this topic.

Tom Clabault

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
VertexArray and transparent texture
« on: March 03, 2019, 02:42:32 pm »
Hi!
I'm in front of a problem that doesn't seem to be that of a challenge but still, I'm stuck with it
I've a Quads vertexArray and I've a .png with transparency in it.
The problem is that when displaying the vertices with the texCoords of the image, it shows black instead of transpanrecy

Here's my .png:


I'm defining the vertices' texCoords as follows:
levelVertex[0].texCoords = CORNER_UP_LEFT_TEXTURE;
levelVertex[1].texCoords = CORNER_UP_RIGHT_TEXTURE;
levelVertex[2].texCoords = CORNER_BOTTOM_RIGHT_TEXTURE;
levelVertex[3].texCoords = CORNER_BOTTOM_LEFT_TEXTURE;
 

When displaying, here's what I get:


I tried to set the four vertices' color to sf::Color::Transparent but with that done, it displays a full black Quad

Any thoughts about that?

NGM88

  • Full Member
  • ***
  • Posts: 162
    • View Profile
Re: VertexArray and transparent texture
« Reply #1 on: March 03, 2019, 02:52:58 pm »
What's behind it?

Tom Clabault

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Email
Re: VertexArray and transparent texture
« Reply #2 on: March 03, 2019, 03:35:32 pm »
Hum, I think you found the problem

Behind it is supposed to stand the sky but the sky is also a Quad belonging to the same vertexArray.
I'll try some things and I'll tell you

EDIT: Done, I used a Sprite instead of vertices, it worked. Thanks for pointing me in the direction
« Last Edit: March 03, 2019, 03:54:53 pm by Tom Clabault »