mirror of https://github.com/buggins/dlangui.git
bump mapping vertex attributes
This commit is contained in:
parent
f5db3da85f
commit
31f2c79271
|
@ -143,6 +143,10 @@ class Effect : GLProgram {
|
||||||
return getAttribLocation(DefaultAttribute.a_texCoord);
|
return getAttribLocation(DefaultAttribute.a_texCoord);
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
return getAttribLocation(DefaultAttribute.a_normal);
|
return getAttribLocation(DefaultAttribute.a_normal);
|
||||||
|
case TANGENT:
|
||||||
|
return getAttribLocation(DefaultAttribute.a_tangent);
|
||||||
|
case BINORMAL:
|
||||||
|
return getAttribLocation(DefaultAttribute.a_binormal);
|
||||||
default:
|
default:
|
||||||
return super.getVertexElementLocation(type);
|
return super.getVertexElementLocation(type);
|
||||||
}
|
}
|
||||||
|
|
|
@ -119,6 +119,10 @@ enum VertexElementType : ubyte {
|
||||||
POSITION = 0,
|
POSITION = 0,
|
||||||
NORMAL,
|
NORMAL,
|
||||||
COLOR,
|
COLOR,
|
||||||
|
TANGENT,
|
||||||
|
BINORMAL,
|
||||||
|
BLENDWEIGHTS,
|
||||||
|
BLENDINDICES,
|
||||||
TEXCOORD0,
|
TEXCOORD0,
|
||||||
TEXCOORD1,
|
TEXCOORD1,
|
||||||
TEXCOORD2,
|
TEXCOORD2,
|
||||||
|
@ -168,11 +172,16 @@ struct VertexElement {
|
||||||
|
|
||||||
this(VertexElementType type, ubyte size = 0) {
|
this(VertexElementType type, ubyte size = 0) {
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
|
// autoassign default size
|
||||||
switch(type) with (VertexElementType) {
|
switch(type) with (VertexElementType) {
|
||||||
case POSITION:
|
case POSITION:
|
||||||
case NORMAL:
|
case NORMAL:
|
||||||
|
case TANGENT:
|
||||||
|
case BINORMAL:
|
||||||
size = 3;
|
size = 3;
|
||||||
break;
|
break;
|
||||||
|
case BLENDWEIGHTS:
|
||||||
|
case BLENDINDICES:
|
||||||
case COLOR:
|
case COLOR:
|
||||||
size = 4;
|
size = 4;
|
||||||
break;
|
break;
|
||||||
|
@ -503,7 +512,9 @@ class Mesh : RefCountedObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
static Mesh createCubeMesh(vec3 pos, float d=1, vec4 color = vec4(1,1,1,1)) {
|
static Mesh createCubeMesh(vec3 pos, float d=1, vec4 color = vec4(1,1,1,1)) {
|
||||||
Mesh mesh = new Mesh(VertexFormat(VertexElementType.POSITION, VertexElementType.COLOR, VertexElementType.TEXCOORD0));
|
Mesh mesh = new Mesh(VertexFormat(VertexElementType.POSITION, VertexElementType.COLOR, VertexElementType.TEXCOORD0
|
||||||
|
//, VertexElementType.TANGENT, VertexElementType.BINORMAL
|
||||||
|
));
|
||||||
mesh.addCubeMesh(pos, d, color);
|
mesh.addCubeMesh(pos, d, color);
|
||||||
return mesh;
|
return mesh;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue