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

Author Topic: Pass sf::vertex to vertex shader  (Read 2634 times)

0 Members and 1 Guest are viewing this topic.

qualcuno

  • Newbie
  • *
  • Posts: 4
    • View Profile
Pass sf::vertex to vertex shader
« on: October 24, 2024, 10:17:55 am »
Hi,
i'm new to making shaders but from my understanding when using raycasting to make light you should pass the collision points of the rays to the vertex shader to make triangles, i just can't understand how.
Sorry for my bad english

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11045
    • View Profile
    • development blog
    • Email
Re: Pass sf::vertex to vertex shader
« Reply #1 on: October 29, 2024, 11:16:43 am »
It's a bit the other way around. You can draw the vertex array and rendering using the shader.

window.draw(myVertexArray, &shader);

See also the full tutorial on Shaders: https://www.sfml-dev.org/tutorials/2.6/graphics-shader.php
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything