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

Author Topic: New sf::RenderTexture is black  (Read 1348 times)

0 Members and 1 Guest are viewing this topic.

jamesk

  • Guest
New sf::RenderTexture is black
« on: June 04, 2018, 05:00:58 pm »
I'm using the code from this example here:
https://github.com/SFML/SFML/wiki/Source:-HeatHazeShader

And I have the texture distorting correctly. Now I'm placing it in my scene and all alpha transparency is missing. The entire render target (besides the distorted sprite) is black. Without using blend modes is there a way to set the default texture buffer to transparent?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: New sf::RenderTexture is black
« Reply #1 on: June 04, 2018, 05:28:56 pm »
Clear it with a transparent color and display it.

The default behavior is undefined.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jamesk

  • Guest
Re: New sf::RenderTexture is black
« Reply #2 on: June 04, 2018, 10:40:21 pm »
There's no way to clear it from the API:
https://www.sfml-dev.org/documentation/2.5.0/classsf_1_1RenderTexture.php

And the texture instance I get back would be read-only.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: New sf::RenderTexture is black
« Reply #3 on: June 04, 2018, 10:47:23 pm »
What about the function called clear()?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

jamesk

  • Guest
Re: New sf::RenderTexture is black
« Reply #4 on: June 04, 2018, 11:57:51 pm »
goddamnit

 

anything