Granted it's expected.... but I'm looking for suggestions on what I could do to improve the performance. Currently it's causing my app to dip just below 30 FPS(normally at 50 or 60 FPS but I cap it at 30).
Granted it's expected.... but I'm looking for suggestions on what I could do to improve the performance. Currently it's causing my app to dip just below 30 FPS(normally at 50 or 60 FPS but I cap it at 30).
Are you sure it's the shader that's doing it? Try setting your fragment color to a fixed value (commenting out your texture and your luminance value) and test that. I bet there's no difference in speed. Fragment shaders are farmed out to the compute units on the GPU, and run VERY fast.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
Are you sure it's the shader that's doing it? Try setting your fragment color to a fixed value (commenting out your texture and your luminance value) and test that. I bet there's no difference in speed. Fragment shaders are farmed out to the compute units on the GPU, and run VERY fast.
I tried that. My original frag shader only had this line in main() and didn't have the fragColor or Luminance in it. Worked well.
All of the changes I made when comparing the two were in the frag shader. Perhaps I'm doing something wrong??
Dunno. I'm a neophyte when it comes to OpenGL shaders. It might be that one of the calculations you're doing is causing the compute units in the GPU to thrash. Maybe you're asking to do double precision math, for example, or convert parameters to different precision? I understand that can be slow.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
Dunno. I'm a neophyte when it comes to OpenGL shaders. It might be that one of the calculations you're doing is causing the compute units in the GPU to thrash. Maybe you're asking to do double precision math, for example, or convert parameters to different precision? I understand that can be slow.