@Override public void onReceiveMaterialValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersMaterialType<Unit> mat_parameters) { NullCheck.notNull(g); NullCheck.notNull(mat_parameters); final JCGLShadersType g_sh = g.getShaders(); g_sh.shaderUniformPutVector4f(this.u_frag_color, WHITE); }
@Override public void onReceiveMaterialValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersMaterialType<Unit> mat_parameters) { NullCheck.notNull(g); NullCheck.notNull(mat_parameters); final JCGLShadersType g_sh = g.getShaders(); g_sh.shaderUniformPutVector4f(this.u_frag_color, WHITE); } }
@Override public void onReceiveMaterialValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersMaterialType<PVectorI4F<R2SpaceRGBAType>> mat_parameters) { NullCheck.notNull(g); NullCheck.notNull(mat_parameters); final JCGLShadersType g_sh = g.getShaders(); g_sh.shaderUniformPutVector4f(this.u_color, mat_parameters.values()); }
@Override public void onReceiveMaterialValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersMaterialType<PVectorI4F<R2SpaceRGBAType>> mat_parameters) { NullCheck.notNull(g); NullCheck.notNull(mat_parameters); final JCGLShadersType g_sh = g.getShaders(); g_sh.shaderUniformPutVector4f(this.u_color, mat_parameters.values()); } }
@Override public void onReceiveMaterialValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersMaterialType<PVectorI4F<R2SpaceRGBAType>> mat_parameters) { NullCheck.notNull(g); NullCheck.notNull(mat_parameters); final JCGLShadersType g_sh = g.getShaders(); g_sh.shaderUniformPutVector4f(this.u_color, mat_parameters.values()); } }
@Override public void onReceiveMaterialValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersMaterialType<PVectorI4F<R2SpaceRGBAType>> mat_parameters) { NullCheck.notNull(g); NullCheck.notNull(mat_parameters); final JCGLShadersType g_sh = g.getShaders(); g_sh.shaderUniformPutVector4f(this.u_color, mat_parameters.values()); } }
@Test public final void testProgramUniformVector4fCorrect() { final JCGLShadersType s = this.getShaders("main"); final JCGLVertexShaderType v = s.shaderCompileVertex("uniforms0", this.getShaderLines("uniforms0.vert")); final JCGLFragmentShaderType f = s.shaderCompileFragment("valid0", this.getShaderLines("valid0.frag")); final JCGLProgramShaderType p = s.shaderLinkProgram("uniforms0", v, Optional.empty(), f); final Map<String, JCGLProgramUniformType> us = p.getUniforms(); Assert.assertTrue(us.containsKey("fv4")); final JCGLProgramUniformType u = us.get("fv4"); Assert.assertEquals(JCGLType.TYPE_FLOAT_VECTOR_4, u.getType()); s.shaderActivateProgram(p); s.shaderUniformPutVector4f(u, VectorI4F.ZERO); }
@Test public final void testProgramUniformVector4fCorrect() { final JCGLShadersType s = this.getShaders("main"); final JCGLVertexShaderType v = s.shaderCompileVertex("uniforms0", this.getShaderLines("uniforms0.vert")); final JCGLFragmentShaderType f = s.shaderCompileFragment("valid0", this.getShaderLines("valid0.frag")); final JCGLProgramShaderType p = s.shaderLinkProgram("uniforms0", v, Optional.empty(), f); final Map<String, JCGLProgramUniformType> us = p.uniforms(); Assert.assertTrue(us.containsKey("fv4")); final JCGLProgramUniformType u = us.get("fv4"); Assert.assertEquals(JCGLType.TYPE_FLOAT_VECTOR_4, u.type()); s.shaderActivateProgram(p); s.shaderUniformPutVector4f(u, Vectors4D.zero()); }
@Test public final void testProgramUniformVector4fWrong() { final JCGLShadersType s = this.getShaders("main"); final JCGLVertexShaderType v = s.shaderCompileVertex("uniforms0", this.getShaderLines("uniforms0.vert")); final JCGLFragmentShaderType f = s.shaderCompileFragment("valid0", this.getShaderLines("valid0.frag")); final JCGLProgramShaderType p = s.shaderLinkProgram("uniforms0", v, Optional.empty(), f); final Map<String, JCGLProgramUniformType> us = p.getUniforms(); Assert.assertTrue(us.containsKey("b")); final JCGLProgramUniformType u = us.get("b"); Assert.assertEquals(JCGLType.TYPE_BOOLEAN, u.getType()); s.shaderActivateProgram(p); this.expected.expect(JCGLExceptionProgramTypeError.class); s.shaderUniformPutVector4f(u, VectorI4F.ZERO); }
@Test public final void testProgramUniformVector4fNotActive() { final JCGLShadersType s = this.getShaders("main"); final JCGLVertexShaderType v = s.shaderCompileVertex("uniforms0", this.getShaderLines("uniforms0.vert")); final JCGLFragmentShaderType f = s.shaderCompileFragment("valid0", this.getShaderLines("valid0.frag")); final JCGLProgramShaderType p = s.shaderLinkProgram("uniforms0", v, Optional.empty(), f); final Map<String, JCGLProgramUniformType> us = p.getUniforms(); Assert.assertTrue(us.containsKey("fv4")); final JCGLProgramUniformType u = us.get("fv4"); Assert.assertEquals(JCGLType.TYPE_FLOAT_VECTOR_4, u.getType()); s.shaderDeactivateProgram(); this.expected.expect(JCGLExceptionProgramNotActive.class); s.shaderUniformPutVector4f(u, VectorI4F.ZERO); }
@Test public final void testProgramUniformVector4fNotActive() { final JCGLShadersType s = this.getShaders("main"); final JCGLVertexShaderType v = s.shaderCompileVertex("uniforms0", this.getShaderLines("uniforms0.vert")); final JCGLFragmentShaderType f = s.shaderCompileFragment("valid0", this.getShaderLines("valid0.frag")); final JCGLProgramShaderType p = s.shaderLinkProgram("uniforms0", v, Optional.empty(), f); final Map<String, JCGLProgramUniformType> us = p.uniforms(); Assert.assertTrue(us.containsKey("fv4")); final JCGLProgramUniformType u = us.get("fv4"); Assert.assertEquals(JCGLType.TYPE_FLOAT_VECTOR_4, u.type()); s.shaderDeactivateProgram(); this.expected.expect(JCGLExceptionProgramNotActive.class); s.shaderUniformPutVector4f(u, Vectors4D.zero()); }
@Test public final void testProgramUniformVector4fWrong() { final JCGLShadersType s = this.getShaders("main"); final JCGLVertexShaderType v = s.shaderCompileVertex("uniforms0", this.getShaderLines("uniforms0.vert")); final JCGLFragmentShaderType f = s.shaderCompileFragment("valid0", this.getShaderLines("valid0.frag")); final JCGLProgramShaderType p = s.shaderLinkProgram("uniforms0", v, Optional.empty(), f); final Map<String, JCGLProgramUniformType> us = p.uniforms(); Assert.assertTrue(us.containsKey("b")); final JCGLProgramUniformType u = us.get("b"); Assert.assertEquals(JCGLType.TYPE_BOOLEAN, u.type()); s.shaderActivateProgram(p); this.expected.expect(JCGLExceptionProgramTypeError.class); s.shaderUniformPutVector4f(u, Vectors4D.zero()); }
gs.shaderUniformPutVector4f(u_data, x); ga.arrayObjectBind(this.quad); gd.drawElements(JCGLPrimitives.PRIMITIVE_TRIANGLES);
gs.shaderUniformPutVector4f(u_data, x); ga.arrayObjectBind(this.quad); gd.drawElements(JCGLPrimitives.PRIMITIVE_TRIANGLES);
@Override public void onReceiveMaterialValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersMaterialType<R2TranslucentShaderBasicParameters> mat_parameters) { NullCheck.notNull(g); NullCheck.notNull(mat_parameters); final JCGLTexturesType g_tex = g.getTextures(); final JCGLShadersType g_sh = g.getShaders(); final JCGLTextureUnitContextMutableType tc = mat_parameters.textureUnitContext(); final R2TranslucentShaderBasicParameters values = mat_parameters.values(); final JCGLTextureUnitType unit_albedo = tc.unitContextBindTexture2D(g_tex, values.albedoTexture().texture()); g_sh.shaderUniformPutTexture2DUnit( this.u_texture_albedo, unit_albedo); g_sh.shaderUniformPutVector4f( this.u_color, values.albedoColor()); g_sh.shaderUniformPutFloat( this.u_fade_positive_eye_z_far, values.fadeZFar()); g_sh.shaderUniformPutFloat( this.u_fade_positive_eye_z_near, values.fadeZNear()); }
@Override public void onReceiveMaterialValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersMaterialType<R2TranslucentShaderBasicParameters> mat_parameters) { NullCheck.notNull(g); NullCheck.notNull(mat_parameters); final JCGLTexturesType g_tex = g.getTextures(); final JCGLShadersType g_sh = g.getShaders(); final JCGLTextureUnitContextMutableType tc = mat_parameters.textureUnitContext(); final R2TranslucentShaderBasicParameters values = mat_parameters.values(); final JCGLTextureUnitType unit_albedo = tc.unitContextBindTexture2D(g_tex, values.albedoTexture().texture()); g_sh.shaderUniformPutTexture2DUnit( this.u_texture_albedo, unit_albedo); g_sh.shaderUniformPutVector4f( this.u_color, values.albedoColor()); g_sh.shaderUniformPutFloat( this.u_fade_positive_eye_z_far, values.fadeZFar()); g_sh.shaderUniformPutFloat( this.u_fade_positive_eye_z_near, values.fadeZNear()); }
@Override public void onReceiveMaterialValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersMaterialType<R2TranslucentShaderBasicParameters> mat_parameters) { NullCheck.notNull(g); NullCheck.notNull(mat_parameters); final JCGLTexturesType g_tex = g.getTextures(); final JCGLShadersType g_sh = g.getShaders(); final JCGLTextureUnitContextMutableType tc = mat_parameters.textureUnitContext(); final R2TranslucentShaderBasicParameters values = mat_parameters.values(); final JCGLTextureUnitType unit_albedo = tc.unitContextBindTexture2D(g_tex, values.albedoTexture().texture()); g_sh.shaderUniformPutTexture2DUnit( this.u_texture_albedo, unit_albedo); g_sh.shaderUniformPutVector4f( this.u_color, values.albedoColor()); g_sh.shaderUniformPutFloat( this.u_fade_positive_eye_z_far, values.fadeZFar()); g_sh.shaderUniformPutFloat( this.u_fade_positive_eye_z_near, values.fadeZNear()); }
this.u_texture_specular, unit_specular); g_sh.shaderUniformPutVector4f( this.u_albedo_color, values.albedoColor()); g_sh.shaderUniformPutFloat(
this.u_texture_specular, unit_specular); g_sh.shaderUniformPutVector4f( this.u_albedo_color, values.albedoColor()); g_sh.shaderUniformPutFloat(
this.u_texture_specular, unit_specular); g_sh.shaderUniformPutVector4f( this.u_albedo_color, values.albedoColor()); g_sh.shaderUniformPutFloat(