|
|
@ -32,7 +32,6 @@ |
|
|
|
package com.jme3.renderer; |
|
|
|
package com.jme3.renderer; |
|
|
|
|
|
|
|
|
|
|
|
import com.jme3.material.RenderState; |
|
|
|
import com.jme3.material.RenderState; |
|
|
|
import com.jme3.material.RenderState.BlendFunc; |
|
|
|
|
|
|
|
import com.jme3.math.ColorRGBA; |
|
|
|
import com.jme3.math.ColorRGBA; |
|
|
|
import com.jme3.scene.Mesh; |
|
|
|
import com.jme3.scene.Mesh; |
|
|
|
import com.jme3.scene.VertexBuffer; |
|
|
|
import com.jme3.scene.VertexBuffer; |
|
|
@ -49,123 +48,123 @@ public class RenderContext { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setFaceCullMode(com.jme3.material.RenderState.FaceCullMode) |
|
|
|
* @see RenderState#setFaceCullMode(com.jme3.material.RenderState.FaceCullMode) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RenderState.FaceCullMode cullMode = RenderState.FaceCullMode.Off; |
|
|
|
public RenderState.FaceCullMode cullMode; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setDepthTest(boolean) |
|
|
|
* @see RenderState#setDepthTest(boolean) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean depthTestEnabled = false; |
|
|
|
public boolean depthTestEnabled; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setDepthWrite(boolean) |
|
|
|
* @see RenderState#setDepthWrite(boolean) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean depthWriteEnabled = true; |
|
|
|
public boolean depthWriteEnabled; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setColorWrite(boolean) |
|
|
|
* @see RenderState#setColorWrite(boolean) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean colorWriteEnabled = true; |
|
|
|
public boolean colorWriteEnabled; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see Renderer#setClipRect(int, int, int, int) |
|
|
|
* @see Renderer#setClipRect(int, int, int, int) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean clipRectEnabled = false; |
|
|
|
public boolean clipRectEnabled; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setPolyOffset(float, float) |
|
|
|
* @see RenderState#setPolyOffset(float, float) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean polyOffsetEnabled = false; |
|
|
|
public boolean polyOffsetEnabled; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setPolyOffset(float, float) |
|
|
|
* @see RenderState#setPolyOffset(float, float) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public float polyOffsetFactor = 0; |
|
|
|
public float polyOffsetFactor; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setPolyOffset(float, float) |
|
|
|
* @see RenderState#setPolyOffset(float, float) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public float polyOffsetUnits = 0; |
|
|
|
public float polyOffsetUnits; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see Mesh#setPointSize(float) |
|
|
|
* @see Mesh#setPointSize(float) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public float pointSize = 1; |
|
|
|
public float pointSize; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setLineWidth(float) |
|
|
|
* @see RenderState#setLineWidth(float) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public float lineWidth = 1; |
|
|
|
public float lineWidth; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setBlendMode(com.jme3.material.RenderState.BlendMode) |
|
|
|
* @see RenderState#setBlendMode(com.jme3.material.RenderState.BlendMode) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RenderState.BlendMode blendMode = RenderState.BlendMode.Off; |
|
|
|
public RenderState.BlendMode blendMode; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setBlendEquation(com.jme3.material.RenderState.BlendEquation) |
|
|
|
* @see RenderState#setBlendEquation(com.jme3.material.RenderState.BlendEquation) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RenderState.BlendEquation blendEquation = RenderState.BlendEquation.Add; |
|
|
|
public RenderState.BlendEquation blendEquation; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setBlendEquationAlpha(com.jme3.material.RenderState.BlendEquationAlpha) |
|
|
|
* @see RenderState#setBlendEquationAlpha(com.jme3.material.RenderState.BlendEquationAlpha) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RenderState.BlendEquationAlpha blendEquationAlpha = RenderState.BlendEquationAlpha.InheritColor; |
|
|
|
public RenderState.BlendEquationAlpha blendEquationAlpha; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, |
|
|
|
* @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, |
|
|
|
* com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) |
|
|
|
* com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RenderState.BlendFunc sfactorRGB = RenderState.BlendFunc.One; |
|
|
|
public RenderState.BlendFunc sfactorRGB; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, |
|
|
|
* @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, |
|
|
|
* com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) |
|
|
|
* com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RenderState.BlendFunc dfactorRGB = RenderState.BlendFunc.One; |
|
|
|
public RenderState.BlendFunc dfactorRGB; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, |
|
|
|
* @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, |
|
|
|
* com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) |
|
|
|
* com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RenderState.BlendFunc sfactorAlpha = RenderState.BlendFunc.One; |
|
|
|
public RenderState.BlendFunc sfactorAlpha; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, |
|
|
|
* @see RenderState#setCustomBlendFactors(com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc, |
|
|
|
* com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) |
|
|
|
* com.jme3.material.RenderState.BlendFunc, com.jme3.material.RenderState.BlendFunc) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RenderState.BlendFunc dfactorAlpha = RenderState.BlendFunc.One; |
|
|
|
public RenderState.BlendFunc dfactorAlpha; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see RenderState#setWireframe(boolean) |
|
|
|
* @see RenderState#setWireframe(boolean) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean wireframe = false; |
|
|
|
public boolean wireframe; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see Renderer#setShader(com.jme3.shader.Shader) |
|
|
|
* @see Renderer#setShader(com.jme3.shader.Shader) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int boundShaderProgram; |
|
|
|
public int boundShaderProgram; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see Renderer#setShader(com.jme3.shader.Shader) |
|
|
|
* @see Renderer#setShader(com.jme3.shader.Shader) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Shader boundShader; |
|
|
|
public Shader boundShader; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) |
|
|
|
* @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int boundFBO = 0; |
|
|
|
public int boundFBO; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) |
|
|
|
* @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public FrameBuffer boundFB; |
|
|
|
public FrameBuffer boundFB; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Currently bound Renderbuffer |
|
|
|
* Currently bound Renderbuffer |
|
|
|
* |
|
|
|
* |
|
|
|
* @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) |
|
|
|
* @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int boundRB = 0; |
|
|
|
public int boundRB; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Currently bound draw buffer |
|
|
|
* Currently bound draw buffer |
|
|
@ -174,20 +173,20 @@ public class RenderContext { |
|
|
|
* 0 = GL_COLOR_ATTACHMENT0 |
|
|
|
* 0 = GL_COLOR_ATTACHMENT0 |
|
|
|
* n = GL_COLOR_ATTACHMENTn |
|
|
|
* n = GL_COLOR_ATTACHMENTn |
|
|
|
* where n is an integer greater than 1 |
|
|
|
* where n is an integer greater than 1 |
|
|
|
* |
|
|
|
* |
|
|
|
* @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) |
|
|
|
* @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) |
|
|
|
* @see FrameBuffer#setTargetIndex(int) |
|
|
|
* @see FrameBuffer#setTargetIndex(int) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int boundDrawBuf = -1; |
|
|
|
public int boundDrawBuf; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Currently bound read buffer |
|
|
|
* Currently bound read buffer |
|
|
|
* |
|
|
|
* |
|
|
|
* @see RenderContext#boundDrawBuf |
|
|
|
* @see RenderContext#boundDrawBuf |
|
|
|
* @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) |
|
|
|
* @see Renderer#setFrameBuffer(com.jme3.texture.FrameBuffer) |
|
|
|
* @see FrameBuffer#setTargetIndex(int) |
|
|
|
* @see FrameBuffer#setTargetIndex(int) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int boundReadBuf = -1; |
|
|
|
public int boundReadBuf; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Currently bound element array vertex buffer. |
|
|
|
* Currently bound element array vertex buffer. |
|
|
@ -207,118 +206,114 @@ public class RenderContext { |
|
|
|
* @see Renderer#renderMesh(com.jme3.scene.Mesh, int, int, com.jme3.scene.VertexBuffer[]) |
|
|
|
* @see Renderer#renderMesh(com.jme3.scene.Mesh, int, int, com.jme3.scene.VertexBuffer[]) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int boundArrayVBO; |
|
|
|
public int boundArrayVBO; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Currently bound pixel pack pixel buffer. |
|
|
|
* Currently bound pixel pack pixel buffer. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int boundPixelPackPBO; |
|
|
|
public int boundPixelPackPBO; |
|
|
|
|
|
|
|
|
|
|
|
public int numTexturesSet = 0; |
|
|
|
public int numTexturesSet; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Current bound texture IDs for each texture unit. |
|
|
|
* Current bound texture IDs for each texture unit. |
|
|
|
* |
|
|
|
* |
|
|
|
* @see Renderer#setTexture(int, com.jme3.texture.Texture) |
|
|
|
* @see Renderer#setTexture(int, com.jme3.texture.Texture) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public Image[] boundTextures = new Image[16]; |
|
|
|
public final Image[] boundTextures = new Image[16]; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* IDList for texture units |
|
|
|
* IDList for texture units |
|
|
|
* |
|
|
|
* |
|
|
|
* @see Renderer#setTexture(int, com.jme3.texture.Texture) |
|
|
|
* @see Renderer#setTexture(int, com.jme3.texture.Texture) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public IDList textureIndexList = new IDList(); |
|
|
|
public final IDList textureIndexList = new IDList(); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Currently bound texture unit |
|
|
|
* Currently bound texture unit |
|
|
|
* |
|
|
|
* |
|
|
|
* @see Renderer#setTexture(int, com.jme3.texture.Texture) |
|
|
|
* @see Renderer#setTexture(int, com.jme3.texture.Texture) |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public int boundTextureUnit = 0; |
|
|
|
public int boundTextureUnit; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Stencil Buffer state |
|
|
|
* Stencil Buffer state |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean stencilTest = false; |
|
|
|
public boolean stencilTest; |
|
|
|
public RenderState.StencilOperation frontStencilStencilFailOperation = RenderState.StencilOperation.Keep; |
|
|
|
public RenderState.StencilOperation frontStencilStencilFailOperation; |
|
|
|
public RenderState.StencilOperation frontStencilDepthFailOperation = RenderState.StencilOperation.Keep; |
|
|
|
public RenderState.StencilOperation frontStencilDepthFailOperation; |
|
|
|
public RenderState.StencilOperation frontStencilDepthPassOperation = RenderState.StencilOperation.Keep; |
|
|
|
public RenderState.StencilOperation frontStencilDepthPassOperation; |
|
|
|
public RenderState.StencilOperation backStencilStencilFailOperation = RenderState.StencilOperation.Keep; |
|
|
|
public RenderState.StencilOperation backStencilStencilFailOperation; |
|
|
|
public RenderState.StencilOperation backStencilDepthFailOperation = RenderState.StencilOperation.Keep; |
|
|
|
public RenderState.StencilOperation backStencilDepthFailOperation; |
|
|
|
public RenderState.StencilOperation backStencilDepthPassOperation = RenderState.StencilOperation.Keep; |
|
|
|
public RenderState.StencilOperation backStencilDepthPassOperation; |
|
|
|
public RenderState.TestFunction frontStencilFunction = RenderState.TestFunction.Always; |
|
|
|
public RenderState.TestFunction frontStencilFunction; |
|
|
|
public RenderState.TestFunction backStencilFunction = RenderState.TestFunction.Always; |
|
|
|
public RenderState.TestFunction backStencilFunction; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Vertex attribs currently bound and enabled. If a slot is null, then |
|
|
|
* Vertex attribs currently bound and enabled. If a slot is null, then |
|
|
|
* it is disabled. |
|
|
|
* it is disabled. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public VertexBuffer[] boundAttribs = new VertexBuffer[16]; |
|
|
|
public final VertexBuffer[] boundAttribs = new VertexBuffer[16]; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* IDList for vertex attributes |
|
|
|
* IDList for vertex attributes |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public IDList attribIndexList = new IDList(); |
|
|
|
public final IDList attribIndexList = new IDList(); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* depth test function |
|
|
|
* depth test function |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RenderState.TestFunction depthFunc = RenderState.TestFunction.Less; |
|
|
|
public RenderState.TestFunction depthFunc; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* alpha test function |
|
|
|
* alpha test function |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public RenderState.TestFunction alphaFunc = RenderState.TestFunction.Greater; |
|
|
|
public RenderState.TestFunction alphaFunc; |
|
|
|
|
|
|
|
|
|
|
|
public int initialDrawBuf; |
|
|
|
public int initialDrawBuf; |
|
|
|
public int initialReadBuf; |
|
|
|
public int initialReadBuf; |
|
|
|
|
|
|
|
|
|
|
|
public ColorRGBA clearColor = new ColorRGBA(0,0,0,0); |
|
|
|
public ColorRGBA clearColor = new ColorRGBA(0, 0, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
public RenderContext() { |
|
|
|
* Reset the RenderContext to default GL state |
|
|
|
init(); |
|
|
|
*/ |
|
|
|
} |
|
|
|
public void reset(){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void init() { |
|
|
|
cullMode = RenderState.FaceCullMode.Off; |
|
|
|
cullMode = RenderState.FaceCullMode.Off; |
|
|
|
depthTestEnabled = false; |
|
|
|
depthTestEnabled = false; |
|
|
|
depthWriteEnabled = false; |
|
|
|
depthWriteEnabled = true; |
|
|
|
colorWriteEnabled = false; |
|
|
|
colorWriteEnabled = true; |
|
|
|
clipRectEnabled = false; |
|
|
|
clipRectEnabled = false; |
|
|
|
polyOffsetEnabled = false; |
|
|
|
polyOffsetEnabled = false; |
|
|
|
polyOffsetFactor = 0; |
|
|
|
polyOffsetFactor = 0; |
|
|
|
polyOffsetUnits = 0; |
|
|
|
polyOffsetUnits = 0; |
|
|
|
pointSize = 1; |
|
|
|
pointSize = 1; |
|
|
|
|
|
|
|
lineWidth = 1; |
|
|
|
blendMode = RenderState.BlendMode.Off; |
|
|
|
blendMode = RenderState.BlendMode.Off; |
|
|
|
blendEquation = RenderState.BlendEquation.Add; |
|
|
|
blendEquation = RenderState.BlendEquation.Add; |
|
|
|
blendEquationAlpha = RenderState.BlendEquationAlpha.InheritColor; |
|
|
|
blendEquationAlpha = RenderState.BlendEquationAlpha.InheritColor; |
|
|
|
sfactorRGB = BlendFunc.One; |
|
|
|
sfactorRGB = RenderState.BlendFunc.One; |
|
|
|
dfactorRGB = BlendFunc.One; |
|
|
|
dfactorRGB = RenderState.BlendFunc.One; |
|
|
|
sfactorAlpha = BlendFunc.One; |
|
|
|
sfactorAlpha = RenderState.BlendFunc.One; |
|
|
|
dfactorAlpha = BlendFunc.One; |
|
|
|
dfactorAlpha = RenderState.BlendFunc.One; |
|
|
|
wireframe = false; |
|
|
|
wireframe = false; |
|
|
|
|
|
|
|
|
|
|
|
boundShaderProgram = 0; |
|
|
|
boundShaderProgram = 0; |
|
|
|
boundShader = null; |
|
|
|
boundShader = null; |
|
|
|
boundFBO = 0; |
|
|
|
boundFBO = 0; |
|
|
|
boundFB = null; |
|
|
|
boundFB = null; |
|
|
|
boundRB = 0; |
|
|
|
boundRB = 0; |
|
|
|
boundDrawBuf = -1; |
|
|
|
boundDrawBuf = -1; |
|
|
|
boundReadBuf = -1; |
|
|
|
boundReadBuf = -1; |
|
|
|
boundElementArrayVBO = 0; |
|
|
|
boundElementArrayVBO = 0; |
|
|
|
boundVertexArray = 0; |
|
|
|
boundVertexArray = 0; |
|
|
|
boundArrayVBO = 0; |
|
|
|
boundArrayVBO = 0; |
|
|
|
boundPixelPackPBO = 0; |
|
|
|
boundPixelPackPBO = 0; |
|
|
|
numTexturesSet = 0; |
|
|
|
numTexturesSet = 0; |
|
|
|
for (int i = 0; i < boundTextures.length; i++) |
|
|
|
|
|
|
|
boundTextures[i] = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
textureIndexList.reset(); |
|
|
|
|
|
|
|
boundTextureUnit = 0; |
|
|
|
boundTextureUnit = 0; |
|
|
|
for (int i = 0; i < boundAttribs.length; i++) |
|
|
|
|
|
|
|
boundAttribs[i] = null; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attribIndexList.reset(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stencilTest = false; |
|
|
|
stencilTest = false; |
|
|
|
|
|
|
|
|
|
|
|
frontStencilStencilFailOperation = RenderState.StencilOperation.Keep; |
|
|
|
frontStencilStencilFailOperation = RenderState.StencilOperation.Keep; |
|
|
|
frontStencilDepthFailOperation = RenderState.StencilOperation.Keep; |
|
|
|
frontStencilDepthFailOperation = RenderState.StencilOperation.Keep; |
|
|
|
frontStencilDepthPassOperation = RenderState.StencilOperation.Keep; |
|
|
|
frontStencilDepthPassOperation = RenderState.StencilOperation.Keep; |
|
|
@ -327,9 +322,30 @@ public class RenderContext { |
|
|
|
backStencilDepthPassOperation = RenderState.StencilOperation.Keep; |
|
|
|
backStencilDepthPassOperation = RenderState.StencilOperation.Keep; |
|
|
|
frontStencilFunction = RenderState.TestFunction.Always; |
|
|
|
frontStencilFunction = RenderState.TestFunction.Always; |
|
|
|
backStencilFunction = RenderState.TestFunction.Always; |
|
|
|
backStencilFunction = RenderState.TestFunction.Always; |
|
|
|
|
|
|
|
|
|
|
|
depthFunc = RenderState.TestFunction.LessOrEqual; |
|
|
|
depthFunc = RenderState.TestFunction.Less; |
|
|
|
alphaFunc = RenderState.TestFunction.Greater; |
|
|
|
alphaFunc = RenderState.TestFunction.Greater; |
|
|
|
clearColor.set(0,0,0,0); |
|
|
|
cullMode = RenderState.FaceCullMode.Off; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
clearColor.set(0, 0, 0, 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Reset the RenderContext to default GL state |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public void reset(){ |
|
|
|
|
|
|
|
init(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < boundTextures.length; i++) { |
|
|
|
|
|
|
|
boundTextures[i] = null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
textureIndexList.reset(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < boundAttribs.length; i++) { |
|
|
|
|
|
|
|
boundAttribs[i] = null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
attribIndexList.reset(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|