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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - grzyboleusz

Pages: [1]
1
SFML projects / Re: Let There Be Light 2
« on: March 17, 2020, 11:31:27 am »
As I said, there it is:

Shader to add global directional lighting, every pixel is lit from given direction vector without cosidering the distance (slightly modified version of the one included in the library, I only use it to draw light with additive blending):

(click to show/hide)

Also, I needed a shader to correct rotated normal maps of the sprites so there it is:
(click to show/hide)

As you can see, it uses vertex color channels to represent rotation and flipping, so you dont have to set any uniforms while drawing - useful for collective VertexArrays
Red color - if lower than 1.0 (or 255 in sf::Color) flips the normal map horizontally
Green  color - if lower than 1.0 (or 255 in sf::Color) flips the normal map vertically
Blue color - is angle in radians divided by Tau (2 * Pi)
Simply use it to draw normal maps

2
SFML projects / Re: Let There Be Light 2
« on: March 12, 2020, 02:51:20 pm »
Hello, I've been using SFML for quite a while, but stumbled upon this gem of a library a few days ago.

I have successfully integrated Alia5's version of LTBL2 and I am VERY pleased with it but there's 1 thing missing for me to achive what I want:
I'd love to have a directional light source to interact with normal/specular maps - a way to lit the surface of every object drawn to normal map buffer from given angle, a kind of global light source.
I suspect it can be done after every other light source is drawn with slight modification of existing shaders, but currently it's beyond me. If I'll manage to do it I'll post it here, but feel free to be first if it's no biggie to you  :-*

Many thanks to everyone involved in this project and SFML itself.

Pages: [1]