Hello Guest

Help with Shaders rendering (vertical gradients result in plain color)

  • 2 Replies
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).
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.
« Last Edit: August 03, 2016, 16:15:50 by _gjkf_ »


Offline spasi

  • *****
  • 2256
    • WebHotelier
Re: Help with Font rendering
« Reply #1 on: July 24, 2016, 11:51:03 »
The drawText method calls glPushMatrix() twice but glPopMatrix() only once.

Re: Help with Font rendering
« Reply #2 on: July 24, 2016, 14:19:18 »
Thanks for the tip but still not works. The problem persists and nothing really changed.