I'm currently working on a project for school. It is my first experience with openGL, but I've had and am having a blast trying to learn my way through the different aspects of openGL and what jMonkey has too offer. However I'm trying to get everything in black and white and I've been wrestling with it for a week now.
I've tried using the grayscale shader provided by sceneworker but all it does it make everything gray. It doesn't just give them a gray shader, it makes everything compleltly grey including the skybox etc.
vertex shader:
void main() {
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
vec3 N = normalize(gl_NormalMatrix * gl_Normal);
vec4 V = gl_ModelViewMatrix * gl_Vertex;
vec3 L = normalize(gl_LightSource[0].position.xyz - V.xyz);
vec3 H = normalize(L + vec3(0.0, 0.0, 1.0));
Is the shader I'm currently using wrong? Will this work in combination with the engine (I've read when you do things in shaders, everything should be done in shaders or else it won't work) ? Or can this effect by achieved by using the engine and not using shaders all together? Maybe I can adjust the color-index so that it only contains grayscales? According to the web, GLUT should be able to adjust this, but I don't think the Java implementation supports this.
Both shaders seems to be fine. But they both operating by vertex colors, not fragment colors and this mean that in reality all your object will be gray, because normally you do not change vertex colors and so they stay in default and the same color everywhere.
I guess that you want to see your texture in gray color. Use something like following
can this shader be used for timed saturation/desaturation controller, i.e transition over time from black and white to color and vice-versa, can someone explain what needs to be done to accomplish this and secondly can parts of a model's texure be actively excluded from the effect somehow.
can this shader be used for timed saturation/desaturation controller, i.e transition over time from black and white to color and vice-versa, can someone explain what needs to be done to accomplish this and secondly can parts of a model's texure be actively excluded from the effect somehow.
All you said is possible but the 2nd part is not simple. Fastest way is to use a stencil buffer and draw the parts that are to be excluded, if that is not possible you may need to use offscreen buffers..