@Test public final void testProgramUniformFloatCorrect() { 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("f")); final JCGLProgramUniformType u = us.get("f"); Assert.assertEquals(JCGLType.TYPE_FLOAT, u.type()); s.shaderActivateProgram(p); s.shaderUniformPutFloat(u, 1.0f); }
@Test public final void testProgramUniformFloatCorrect() { 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("f")); final JCGLProgramUniformType u = us.get("f"); Assert.assertEquals(JCGLType.TYPE_FLOAT, u.getType()); s.shaderActivateProgram(p); s.shaderUniformPutFloat(u, 1.0f); }
@Test public final void testProgramUniformFloatWrong() { 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.shaderUniformPutFloat(u, 1.0f); }
@Test public final void testProgramUniformFloatWrongTypeNoChecking() { 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.shaderUniformSetTypeCheckingEnabled(false); s.shaderActivateProgram(p); s.shaderUniformPutFloat(u, 1.0f); }
@Test public final void testProgramUniformFloatNotActive() { 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("f")); final JCGLProgramUniformType u = us.get("f"); Assert.assertEquals(JCGLType.TYPE_FLOAT, u.type()); s.shaderDeactivateProgram(); this.expected.expect(JCGLExceptionProgramNotActive.class); s.shaderUniformPutFloat(u, 1.0f); }
@Test public final void testProgramUniformFloatWrong() { 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.shaderUniformPutFloat(u, 1.0f); }
@Test public final void testProgramUniformFloatNotActive() { 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("f")); final JCGLProgramUniformType u = us.get("f"); Assert.assertEquals(JCGLType.TYPE_FLOAT, u.getType()); s.shaderDeactivateProgram(); this.expected.expect(JCGLExceptionProgramNotActive.class); s.shaderUniformPutFloat(u, 1.0f); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType m = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(m.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, m.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, m.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); }
@Override public void onReceiveViewValues( final JCGLInterfaceGL33Type g, final R2ShaderParametersViewType view_parameters) { NullCheck.notNull(g); NullCheck.notNull(view_parameters); final JCGLShadersType g_sh = g.getShaders(); final R2MatricesObserverValuesType matrices = view_parameters.observerMatrices(); g_sh.shaderUniformPutFloat( this.u_depth_coefficient, (float) R2Projections.getDepthCoefficient(matrices.projection())); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view, matrices.matrixView()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_projection, matrices.matrixProjection()); g_sh.shaderUniformPutMatrix4x4f( this.u_transform_view_inverse, matrices.matrixViewInverse()); }