add PointSize to Unshaded matdef, test with SkeletonDebugger

fix-456
Stephen Gold 8 years ago
parent a64175c0f1
commit 259f599d1d
  1. 1
      jme3-core/src/main/java/com/jme3/scene/debug/SkeletonInterBoneWire.java
  2. 1
      jme3-core/src/main/java/com/jme3/scene/debug/SkeletonPoints.java
  3. 3
      jme3-core/src/main/resources/Common/MatDefs/Misc/Unshaded.j3md
  4. 5
      jme3-core/src/main/resources/Common/MatDefs/Misc/Unshaded.vert
  5. 3
      jme3-examples/src/main/java/jme3test/model/anim/TestAnimBlendBug.java
  6. 1
      jme3-examples/src/main/java/jme3test/model/anim/TestOgreComplexAnim.java

@ -73,7 +73,6 @@ public class SkeletonInterBoneWire extends Mesh {
}
this.setMode(Mode.Points);
this.setPointSize(1);
this.boneLengths = boneLengths;
VertexBuffer pb = new VertexBuffer(Type.Position);

@ -84,7 +84,6 @@ public class SkeletonPoints extends Mesh {
pb.setupData(Usage.Stream, 3, Format.Float, fpb);
this.setBuffer(pb);
this.setPointSize(7);
this.updateCounts();
}

@ -5,6 +5,7 @@ MaterialDef Unshaded {
Texture2D LightMap
Color Color (Color)
Boolean VertexColor (UseVertexColor)
Float PointSize : 1.0
Boolean SeparateTexCoord
// Texture of the glowing parts of the material
@ -71,6 +72,7 @@ MaterialDef Unshaded {
HAS_COLORMAP : ColorMap
HAS_LIGHTMAP : LightMap
HAS_VERTEXCOLOR : VertexColor
HAS_POINTSIZE : PointSize
HAS_COLOR : Color
NUM_BONES : NumberOfBones
DISCARD_ALPHA : AlphaDiscardThreshold
@ -176,6 +178,7 @@ MaterialDef Unshaded {
HAS_GLOWCOLOR : GlowColor
NUM_BONES : NumberOfBones
INSTANCING : UseInstancing
HAS_POINTSIZE : PointSize
}
}
}

@ -16,6 +16,7 @@ varying vec2 texCoord1;
varying vec2 texCoord2;
varying vec4 vertColor;
uniform float m_PointSize;
void main(){
#ifdef NEED_TEXCOORD1
@ -30,6 +31,10 @@ void main(){
vertColor = inColor;
#endif
#ifdef HAS_POINTSIZE
gl_PointSize = m_PointSize;
#endif
vec4 modelSpacePos = vec4(inPosition, 1.0);
#ifdef NUM_BONES
Skinning_Compute(modelSpacePos);

@ -115,7 +115,8 @@ public class TestAnimBlendBug extends SimpleApplication implements ActionListene
SkeletonDebugger skeletonDebug = new SkeletonDebugger("skeleton1", control1.getSkeleton());
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.getAdditionalRenderState().setWireframe(true);
mat.setColor("Color", ColorRGBA.Green);
mat.setColor("Color", ColorRGBA.Red);
mat.setFloat("PointSize", 7f);
mat.getAdditionalRenderState().setDepthTest(false);
skeletonDebug.setMaterial(mat);
model1.attachChild(skeletonDebug);

@ -106,6 +106,7 @@ public class TestOgreComplexAnim extends SimpleApplication {
Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
mat.getAdditionalRenderState().setWireframe(true);
mat.setColor("Color", ColorRGBA.Green);
mat.setFloat("PointSize", 7f);
mat.getAdditionalRenderState().setDepthTest(false);
skeletonDebug.setMaterial(mat);

Loading…
Cancel
Save