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

Author Topic: RenderTarget - Multiply mode?  (Read 3341 times)

0 Members and 1 Guest are viewing this topic.

Saitei

  • Newbie
  • *
  • Posts: 23
    • View Profile
RenderTarget - Multiply mode?
« on: August 20, 2014, 10:20:10 am »
Can I draw RenderTarget with "multiply mode"? How? (I need to do this, cause I came up with how to make the light)
P.S: Sorry for my stupid questions(
« Last Edit: August 20, 2014, 10:41:05 am by Saitei »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: RenderTarget - Multiply mode?
« Reply #1 on: August 20, 2014, 10:34:58 am »
The same way as with a RenderWindow, by applying blend modes.

Also use the edit function if you want to add something and nobody has replied yet.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Saitei

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: RenderTarget - Multiply mode?
« Reply #2 on: August 20, 2014, 10:50:50 am »
The same way as with a RenderWindow, by applying blend modes.

Also use the edit function if you want to add something and nobody has replied yet.
Sorry, more of this will not happen again.

Also, I founded sf::BlendMode::BlendMultiply... But I do not understand how to use it.
I want draw my rendertarget over the window with multiply mode. Sprites already drawed at the window, render target ready too.



eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Saitei

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: RenderTarget - Multiply mode?
« Reply #4 on: August 20, 2014, 01:31:49 pm »
The documentation is your friend. ;D

http://sfml-dev.org/documentation/2.1/classsf_1_1RenderTarget.php#a12417a3bcc245c41d957b29583556f39
http://sfml-dev.org/documentation/2.1/classsf_1_1RenderStates.php#ad29672df29f19ce50c3021d95f2bb062
http://sfml-dev.org/documentation/2.1/group__graphics.php#ga80c52fe2f7050d7f7573b7ed3c995388

Also this forum has a search, I'm 100% certain you'd have found an answer that way as well.
When i call method "draw" at RenderTexture - all draws at the texture, when i call method "draw" at RenderWindow - all draw at the window - do I understand correctly?

If it is thanks for the help!

Rhimlock

  • Jr. Member
  • **
  • Posts: 73
    • View Profile
Re: RenderTarget - Multiply mode?
« Reply #5 on: August 20, 2014, 02:58:10 pm »
Yes,

RenderTexture.draw - draws to the RenderTexture
RenderWindow.draw - draws to the RenderWindow


Don't forget to call RenderTexture.display(), after you draw everything to your RenderTexture.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: RenderTarget - Multiply mode?
« Reply #6 on: August 20, 2014, 05:36:18 pm »
Don't forget to call RenderTexture.display(), after you draw everything to your RenderTexture.
and clear() before you draw().