Hi,
having a simple fragment program which is just used to mix two textures by a custom value I want to set a parameter which sets the mixing value. The shader works fine - if I hardcode the mixing the value. As soon as I start setting the parameter there is nothing visible at all. So I am basically asking whats wrong with my code
hmm, wild guess here, but have you tried a FloatBuffer instead of float[]… lwjgl loves to switch to those.
? hmm. Sorry, but I don't know what you mean :? - the setParameter function uses just float[], right?
Yeah, sorry. Was thinking of attribute pointers (GLSL)
ok. But is there any example - found none in the jmetest - where parameters are assigned to fragment programs?
Not to Fragment, but TestVertexProgramState does set a param.
hmm, I don't see the difference after changing the value :?
Nethertheless I tried to set params in fragmentprogram again. Same result - no result
Actually, I just hardcoded values into the vertex program for light position and it changed nothing… I also commented the only line that uses lightpos out in the program and it also affected nothing. (As a sanity check, I put some garbage in the file and it broke the app, so the tests were in fact using my changes program.)
So, I guess it's a bad case.
Are you making sure your argument ids are the same? I notice in the test program it uses 8, but the shader accesses local var 0, so I would expect those not to match properly.
yeah, I also recognized that you are using id 8 - so I tried all 24 … but none of them worked.
mmm…I've tried this on another test and I also can't seem to get any updates happening.
Anyone got any clues as to doing realtime shader parameter manipulation?
Is it possible?
cheers,
sv