Merge pull request #633 from stephengold/master

add PointSize to Unshaded matdef, test with SkeletonDebugger
This commit is contained in:
Stephen Gold 2017-04-05 13:35:51 -07:00 committed by GitHub
commit 5f9cf52c13
6 changed files with 13 additions and 3 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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