@Override public void draw() { super.draw(); NoosaScript script = NoosaScript.get(); texture.bind(); script.camera( camera() ); script.uModel.valueM4( matrix ); script.lighting( rm, gm, bm, am, ra, ga, ba, aa ); script.drawQuadSet( verticesBuffer, 9 ); } }
private void drawRays() { NoosaScript script = NoosaScript.get(); texture.bind(); script.uModel.valueM4( matrix ); script.lighting( rm, gm, bm, am, ra, ga, ba, aa ); script.camera( camera ); script.drawElements( vertices, indices, nRays * 3 ); } }
@Override public void draw() { if (texture == null || (!dirty && buffer == null)) return; super.draw(); if (dirty) { verticesBuffer.position( 0 ); verticesBuffer.put( vertices ); if (buffer == null) buffer = new Vertexbuffer( verticesBuffer ); else buffer.updateVertices( verticesBuffer ); dirty = false; } NoosaScript script = script(); texture.bind(); script.camera( camera() ); script.uModel.valueM4( matrix ); script.lighting( rm, gm, bm, am, ra, ga, ba, aa ); script.drawQuad( buffer ); }
@Override public void onDrawFrame( GL10 gl ) { if (width == 0 || height == 0) { return; } SystemTime.tick(); long rightNow = SystemTime.now; step = (now == 0 ? 0 : rightNow - now); now = rightNow; step(); NoosaScript.get().resetCamera(); GLES20.glScissor( 0, 0, width, height ); GLES20.glClear( GLES20.GL_COLOR_BUFFER_BIT ); draw(); }
script.camera( camera ); script.drawQuadSet( buffer, length, topLeft );
protected NoosaScript script(){ return NoosaScript.get(); }
private void drawRays() { NoosaScript script = NoosaScript.get(); texture.bind(); script.uModel.valueM4( matrix ); script.lighting( rm, gm, bm, am, ra, ga, ba, aa ); script.camera( camera ); script.drawElements( vertices, indices, nRays * 3 ); } }
@Override public void draw() { if (texture == null || (!dirty && buffer == null)) return; super.draw(); if (dirty) { verticesBuffer.position( 0 ); verticesBuffer.put( vertices ); if (buffer == null) buffer = new Vertexbuffer( verticesBuffer ); else buffer.updateVertices( verticesBuffer ); dirty = false; } NoosaScript script = script(); texture.bind(); script.camera( camera() ); script.uModel.valueM4( matrix ); script.lighting( rm, gm, bm, am, ra, ga, ba, aa ); script.drawQuad( buffer ); }
@Override public void onDrawFrame( GL10 gl ) { if (width == 0 || height == 0) { return; } NoosaScript.get().resetCamera(); NoosaScriptNoLighting.get().resetCamera(); GLES20.glDisable(GLES20.GL_SCISSOR_TEST); GLES20.glClear(GLES20.GL_COLOR_BUFFER_BIT); draw(); GLES20.glFlush(); SystemTime.tick(); long rightNow = SystemClock.elapsedRealtime(); step = (now == 0 ? 0 : rightNow - now); now = rightNow; step(); }
script.camera( camera ); script.drawQuadSet( buffer, length, topLeft );
protected NoosaScript script(){ return NoosaScript.get(); }
@Override public void draw() { super.draw(); NoosaScript script = NoosaScript.get(); font.texture.bind(); if (dirty) { updateVertices(); } script.camera( camera() ); script.uModel.valueM4( matrix ); script.lighting( rm, gm, bm, am, ra, ga, ba, aa ); script.drawQuadSet( quads, realLength ); }
private void drawRays() { NoosaScript script = NoosaScript.get(); texture.bind(); script.uModel.valueM4( matrix ); script.lighting( rm, gm, bm, am, ra, ga, ba, aa ); script.camera( camera ); script.drawElements( vertices, indices, nRays * 3 ); } }
@Override public void draw() { if (texture == null || (!dirty && buffer == null)) return; if (renderShadow) { if (dirty) { verticesBuffer.position(0); verticesBuffer.put(vertices); if (buffer == null) buffer = new Vertexbuffer(verticesBuffer); else buffer.updateVertices(verticesBuffer); dirty = false; } NoosaScript script = script(); texture.bind(); script.camera(camera()); updateMatrix(); script.uModel.valueM4(shadowMatrix); script.lighting( 0, 0, 0, am * .6f, 0, 0, 0, aa * .6f); script.drawQuad(buffer); } super.draw(); }
public NoosaScript() { super(); compile( shader() ); uCamera = uniform( "uCamera" ); uModel = uniform( "uModel" ); uTex = uniform( "uTex" ); uColorM = uniform( "uColorM" ); uColorA = uniform( "uColorA" ); aXY = attribute( "aXYZW" ); aUV = attribute( "aUV" ); Quad.setupIndices(); Quad.bindIndices(); }
@Override public void render() { if (width == 0 || height == 0) { return; } NoosaScript.get().resetCamera(); NoosaScriptNoLighting.get().resetCamera(); Gdx.gl.glDisable( GL20.GL_SCISSOR_TEST ); Gdx.gl.glClear( GL20.GL_COLOR_BUFFER_BIT ); draw(); Gdx.gl.glFlush(); SystemTime.tick(); long rightNow = SystemTime.now; step = (now == 0 ? 0 : rightNow - now); now = rightNow; step(); }
@Override public void draw() { super.draw(); NoosaScript script = NoosaScript.get(); texture.bind(); script.uModel.valueM4( matrix ); script.lighting( rm, gm, bm, am, ra, ga, ba, aa ); if (!updated.isEmpty()) { updateVertices(); } script.camera( camera ); script.drawQuadSet( quads, size ); } }