LWJGL Forum

Programming => OpenGL => Topic started by: _gjkf_ on July 24, 2016, 09:17:45

Title: Help with Shaders rendering (vertical gradients result in plain color)
Post by: _gjkf_ on July 24, 2016, 09:17:45
Good morning everyone,

My problem is with shaders. Especially gradients. I've made a couple of them and they work fine, as long as the gradient is horizontal. If I try to make it vertical, it's just a plain color (the ending one of the gradient).
Code:
The gradient shader: https://github.com/gjkf/seriousEngine/blob/master/src/main/resources/shaders/gradient.glsl
The shader renderer: https://github.com/gjkf/seriousEngine/blob/master/src/main/java/com/gjkf/seriousEngine/core/render/Renderer.java#L269-L352 (Note that I pass some uniforms as an HashMap and that works)
And finally where I draw: https://github.com/gjkf/seriousEngine/blob/master/src/main/java/com/gjkf/seriousEngine/core/render/Renderer.java#L269-L335

I think that should be all. I know it's a lot but I'm really struggling with these.
If you need anything else, feel free to ask.
Thanks for your time.

EDIT: I've added a couple of more problems I have, sorry :(
EDIT: I've solved the Image one, the other 2 still persist.
EDIT: I've solved the Font one, the Shader still causes problems.
Title: Re: Help with Font rendering
Post by: spasi on July 24, 2016, 11:51:03
The drawText method calls glPushMatrix() twice but glPopMatrix() only once.
Title: Re: Help with Font rendering
Post by: _gjkf_ on July 24, 2016, 14:19:18
Thanks for the tip but still not works. The problem persists and nothing really changed.