@Override public void onStart() { this.shaders = this.g33.getShaders(); this.textures = this.g33.getTextures(); this.array_objects = this.g33.getArrayObjects(); this.draw = this.g33.getDraw(); this.program.onActivate(this.g33); this.program.onReceiveViewValues( this.g33, this.configureViewParameters()); }
final JCGLDrawType g_d = g.getDraw(); final JCGLShadersType g_sh = g.getShaders(); final JCGLTexturesType g_tex = g.getTextures();
final JCGLDrawType g_d = g.getDraw(); final JCGLShadersType g_sh = g.getShaders(); final JCGLTexturesType g_tex = g.getTextures();
private OpaqueConsumer( final JCGLInterfaceGL33Type ig) { this.g33 = NullCheck.notNull(ig); this.shaders = this.g33.getShaders(); this.textures = this.g33.getTextures(); this.array_objects = this.g33.getArrayObjects(); this.draw = this.g33.getDraw(); this.render_state = JCGLRenderStateMutable.create(); this.stencil_state = JCGLStencilStateMutable.create(); this.params_view = R2ShaderParametersViewMutable.create(); this.params_material = R2ShaderParametersMaterialMutable.create(); }
JCGLShaderTestFunctionEvaluator( final JCGLInterfaceGL33Type gg, final JCGLProgramShaderType p) throws IOException { final JCGLShadersType gs = gg.getShaders(); final JCGLTexturesType gt = gg.getTextures(); final JCGLArrayObjectsType ga = gg.getArrayObjects(); final JCGLDrawType gd = gg.getDraw(); final JCGLFramebuffersType gf = gg.getFramebuffers(); final List<JCGLTextureUnitType> units = gt.textureGetUnits(); final JCGLTextureFormat fmt = JCGLTextureFormat.TEXTURE_FORMAT_RGBA_32F_16BPP; this.framebuffer = JCGLShadersTestUtilities.newColorFramebuffer(gg, fmt, 2, 2); this.program = p; this.quad = JCGLShadersTestUtilities.newScreenQuad(gg); this.gl = NullCheck.notNull(gg); }
private void renderBatches( final R2MatricesValuesType m, final R2MaskInstancesType s, final JCGLTextureUnitContextType up) { final JCGLArrayObjectsType g_a = this.g.getArrayObjects(); final JCGLDrawType g_d = this.g.getDraw(); final List<R2InstanceBatchedType> batches = s.batched(); if (!batches.isEmpty()) { this.shader_batched.onActivate(this.g); try { this.shader_batched.onReceiveViewValues( this.g, this.configureViewParameters()); this.shader_batched.onReceiveMaterialValues( this.g, this.configureMaterialParameters(up, Unit.unit())); for (int index = 0; index < batches.size(); ++index) { final R2InstanceBatchedType instance = batches.get(index); instance.update(this.g, m.transformContext()); g_a.arrayObjectBind(instance.arrayObject()); this.shader_batched.onValidate(); g_d.drawElementsInstanced( JCGLPrimitives.PRIMITIVE_TRIANGLES, instance.renderCount()); } } finally { this.shader_batched.onDeactivate(this.g); g_a.arrayObjectUnbind(); } } }
final JCGLDrawType g_d = g.getDraw(); final JCGLShadersType g_sh = g.getShaders();
@Override public void onRender(final JCGLInterfaceGL33Type g) { final JCGLArrayObjectsType g_ao = g.getArrayObjects(); final JCGLClearType g_c = g.getClear(); final JCGLDrawType g_d = g.getDraw(); final JCGLShadersType g_sh = g.getShaders(); /** * Clear the window. */ g_c.clear(this.clear); /** * Activate the program, bind the created array object, draw a triangle. */ g_sh.shaderActivateProgram(this.program); g_ao.arrayObjectBind(this.array_object); g_d.drawElements(JCGLPrimitives.PRIMITIVE_TRIANGLES); g_ao.arrayObjectUnbind(); g_sh.shaderDeactivateProgram(); }
private DepthConsumer( final JCGLInterfaceGL33Type ig) { this.g33 = NullCheck.notNull(ig); this.shaders = this.g33.getShaders(); this.textures = this.g33.getTextures(); this.array_objects = this.g33.getArrayObjects(); this.draw = this.g33.getDraw(); this.params_view = R2ShaderParametersViewMutable.create(); this.params_material = R2ShaderParametersMaterialMutable.create(); { this.render_state = JCGLRenderStateMutable.create(); /* * Enable color buffer rendering to the first two channels. */ this.render_state.setColorBufferMaskingState( JCGLColorBufferMaskingState.of(true, true, false, false)); /* * Enable depth testing, writing, and clamping. */ this.render_state.setDepthState(JCGLDepthState.of( JCGLDepthStrict.DEPTH_STRICT_ENABLED, Optional.of(JCGLDepthFunction.DEPTH_LESS_THAN), JCGLDepthWriting.DEPTH_WRITE_ENABLED, JCGLDepthClamping.DEPTH_CLAMP_ENABLED )); } }
private DepthConsumer( final JCGLInterfaceGL33Type ig) { this.g33 = NullCheck.notNull(ig); this.shaders = this.g33.getShaders(); this.textures = this.g33.getTextures(); this.array_objects = this.g33.getArrayObjects(); this.draw = this.g33.getDraw(); this.params_view = R2ShaderParametersViewMutable.create(); this.params_material = R2ShaderParametersMaterialMutable.create(); { this.render_state = JCGLRenderStateMutable.create(); /* * Disable any color buffer rendering (even though the * framebuffer configuration should already cause any * color output to be discarded). */ this.render_state.setColorBufferMaskingState( JCGLColorBufferMaskingState.of(false, false, false, false)); /* * Enable depth testing, writing, and clamping. */ this.render_state.setDepthState(JCGLDepthState.of( JCGLDepthStrict.DEPTH_STRICT_ENABLED, Optional.of(JCGLDepthFunction.DEPTH_LESS_THAN), JCGLDepthWriting.DEPTH_WRITE_ENABLED, JCGLDepthClamping.DEPTH_CLAMP_ENABLED )); } }
OpaqueConsumer( final JCGLInterfaceGL33Type ig, final R2ShaderInstanceSingleType<PVectorI4F<R2SpaceRGBAType>> in_shader_single, final R2ShaderInstanceBatchedType<PVectorI4F<R2SpaceRGBAType>> in_shader_batched, final R2ShaderInstanceBillboardedType<PVectorI4F<R2SpaceRGBAType>> in_shader_billboarded) { this.g33 = NullCheck.notNull(ig); this.shader_single = NullCheck.notNull(in_shader_single); this.shader_batched = NullCheck.notNull(in_shader_batched); this.shader_billboarded = NullCheck.notNull(in_shader_billboarded); this.shaders = this.g33.getShaders(); this.textures = this.g33.getTextures(); this.array_objects = this.g33.getArrayObjects(); this.draw = this.g33.getDraw(); this.render_state = JCGLRenderStateMutable.create(); this.params_view = R2ShaderParametersViewMutable.create(); this.params_material = R2ShaderParametersMaterialMutable.create(); }
final JCGLDrawType g_d = g.getDraw(); final JCGLShadersType g_sh = g.getShaders();
tt.shader_single.onReceiveInstanceTransformValues(tt.g, mi); tt.shader_single.onValidate(); tt.g.getDraw().drawElements( JCGLPrimitives.PRIMITIVE_TRIANGLES); return Unit.unit();
@Override public void onRender(final JCGLInterfaceGL33Type g) { final JCGLArrayObjectsType g_ao = g.getArrayObjects(); final JCGLClearType g_c = g.getClear(); final JCGLDrawType g_d = g.getDraw(); final JCGLShadersType g_sh = g.getShaders(); final JCGLTexturesType g_tex = g.getTextures(); /** * Clear the window. */ g_c.clear(this.clear); /** * Activate the program, bind the created array object, draw a triangle. */ final List<JCGLTextureUnitType> units = g_tex.textureGetUnits(); final JCGLTextureUnitType u0 = units.get(0); g_tex.texture2DBind(u0, this.texture); g_sh.shaderActivateProgram(this.program); g_sh.shaderUniformPutTexture2DUnit(this.texture_uniform, u0); g_ao.arrayObjectBind(this.array_object); g_d.drawElements(JCGLPrimitives.PRIMITIVE_TRIANGLES); g_ao.arrayObjectUnbind(); g_sh.shaderDeactivateProgram(); }
final JCGLTexturesType gt = this.gl.getTextures(); final JCGLArrayObjectsType ga = this.gl.getArrayObjects(); final JCGLDrawType gd = this.gl.getDraw(); final JCGLFramebuffersType gf = this.gl.getFramebuffers();
final JCGLDrawType g_d = g.getDraw(); final JCGLShadersType g_sh = g.getShaders(); final JCGLTexturesType g_tex = g.getTextures();
final JCGLTexturesType gt = this.gl.getTextures(); final JCGLArrayObjectsType ga = this.gl.getArrayObjects(); final JCGLDrawType gd = this.gl.getDraw(); final JCGLFramebuffersType gf = this.gl.getFramebuffers();
final JCGLDrawType g_d = this.g.getDraw(); try { g_ao.arrayObjectBind(ao);
final JCGLTexturesType g_tex = this.g33.getTextures(); final JCGLArrayObjectsType g_ao = this.g33.getArrayObjects(); final JCGLDrawType g_dr = this.g33.getDraw();
final JCGLDrawType g_dr = this.g33.getDraw();