Author Topic: Need Help with GLSL  (Read 2360 times)

Offline lajidahe22

  • byte
  • *
  • Posts: 1
    • View Profile
Need Help with GLSL
« on: October 18, 2011, 01:29:51 am »
Hi, I am having trouble with the newest version of JPCT-ae. I want to modify the modelviewproject matrix, so I used "shader.setUniform("modelViewProjectionMatrix", iMatrix);", but it did not work. I even set the matrix to all 0s, it still does not affect the actual gl renderer. Could you tell me what is going on?
Thank you very much

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Need Help with GLSL
« Reply #1 on: October 18, 2011, 11:48:10 am »
That's not how it's supposed to work. If you want to modify this matrix, just to it by applying transformations to the object itself. The matrix will be injected based on the object's transformations. You are not supposed to override it with some other value. If need another/different matrix, just choose another name for your uniform and use that in your shader.
« Last Edit: October 18, 2011, 09:33:23 pm by EgonOlsen »