Use VBOs for vertices, indices when using shaders; multiply vertices by

weights even if we only have one weight per vertex.


git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@232 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Andrzej Kapolka
2007-05-09 19:51:32 +00:00
parent 0024a02067
commit 45df6d814b
3 changed files with 12 additions and 10 deletions
@@ -408,7 +408,7 @@ public class ModelMesh extends TriMesh
TextureState tstate = tprov.getTexture(_emissiveMap);
emissiveTex = tstate.getTexture();
emissiveTex.setApply(Texture.AM_BLEND);
emissiveTex.setBlendColor(ColorRGBA.white);
emissiveTex.getBlendColor().set(ColorRGBA.white);
}
_tstates = new TextureState[_textures.length];
for (int ii = 0; ii < _textures.length; ii++) {
@@ -343,14 +343,8 @@ public class SkinMesh extends ModelMesh
public void lockStaticMeshes (
Renderer renderer, boolean useVBOs, boolean useDisplayLists)
{
// we can use VBOs for color, texture, and indices
// we can use VBOs for color, texture, and indices if not using shaders
if (useVBOs && renderer.supportsVBO()) {
VBOInfo vboinfo = new VBOInfo(false);
vboinfo.setVBOColorEnabled(true);
vboinfo.setVBOTextureEnabled(true);
vboinfo.setVBOIndexEnabled(!_translucent);
setVBOInfo(vboinfo);
// use VBOs for shader attributes
GLSLShaderObjectsState sstate = (GLSLShaderObjectsState)getRenderState(
RenderState.RS_GLSL_SHADER_OBJECTS);
@@ -359,6 +353,14 @@ public class SkinMesh extends ModelMesh
attrib.useVBO = true;
}
}
VBOInfo vboinfo = new VBOInfo(true);
if (sstate == null) {
vboinfo.setVBOVertexEnabled(false);
vboinfo.setVBONormalEnabled(false);
}
vboinfo.setVBOIndexEnabled(!_translucent);
setVBOInfo(vboinfo);
}
_useDisplayLists = useDisplayLists && !_translucent;
}