Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Sep 2011
Offline Last Active Oct 29 2014 09:56 AM

Posts I've Made

In Topic: [GLSL] NVIDIA vs ATI shader problem

30 March 2014 - 03:47 AM

Ok I finally solved it with the help of you guys!


The problem was in the attribute locations in the vertex shader. NV automatically generates those according to the order in which the attributes where defined, while ATI needs to have the explicit layout(location = index) in front of each attribute. Also I switched to #version 330 otherwise those layout() identifiers are not available. The version change is no problem since i want to implement a deferred renderer in the next step anyway.


Again, thank you for your help!

In Topic: [GLSL] NVIDIA vs ATI shader problem

30 March 2014 - 01:51 AM

So does anyone have a clue why the line posted above would make a problem on ati but not on NV?

In Topic: [GLSL] NVIDIA vs ATI shader problem

29 March 2014 - 01:23 PM

It gives a compiler error without specified #version directive. I decided on version 130 to support as much hardware as possible.

In Topic: [GLSL] NVIDIA vs ATI shader problem

29 March 2014 - 12:02 PM

I tracked at least one of the issues down to this line in the vertex shader:

vNormal = normalize((gNormalMatrix * vec4(inNormal,0.0f)).xyz);

If I uncomment it, the vertex positions are correct. As soon as I don't uncomment this line the plane is not being rendered at all and the sphere's texcoords are wrong.


Any idea what might cause this?


EDIT: I changed all constant float values to have an f after them.

In Topic: [GLSL] Question about normal mapping

28 March 2014 - 10:57 AM

Thanks Johnny Code for the clarification. I want to shade 4 lights.


4 varying vec4 vectors are lowend gpus likely limit.  But in any case, you have those 2 methods available . Which one is more effective depends on amount of lights you are to shade, 4 lights are likely limit of the first method to compute less, since method 2 demands only normal+tangent+postion interpolation and moving texture normal to object space. The second method is also more effective if amount of vertices of model is bigger than its fillrate.


Well it's highly unlikely that there is less fillrate than vertices, at least with the game I am making(mid-poly count with cartoony art style).