mirror of
https://gitlab.com/shinovon/re3-symbian.git
synced 2026-05-22 17:47:20 +03:00
VC4 fixes
Fixed lags on specific conditions, skinning
This commit is contained in:
parent
2829feffad
commit
a3847a9768
7 changed files with 32 additions and 13 deletions
20
vendor/librw/src/gl/gl3immed.cpp
vendored
20
vendor/librw/src/gl/gl3immed.cpp
vendored
|
|
@ -118,6 +118,11 @@ im2DRenderPrimitive(PrimitiveType primType, void *vertices, int32 numVertices)
|
|||
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, u));
|
||||
|
||||
glDisableVertexAttribArray(ATTRIB_NORMAL);
|
||||
glDisableVertexAttribArray(ATTRIB_WEIGHTS);
|
||||
glDisableVertexAttribArray(ATTRIB_INDICES);
|
||||
glDisableVertexAttribArray(ATTRIB_TEXCOORDS1);
|
||||
|
||||
glDrawArrays(primTypeMap[primType], 0, numVertices);
|
||||
|
||||
glDisableVertexAttribArray(ATTRIB_POS);
|
||||
|
|
@ -151,6 +156,11 @@ im2DRenderIndexedPrimitive(PrimitiveType primType,
|
|||
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im2DVertex), (uint8*)vertices + OFFSET_OF(Im2DVertex, u));
|
||||
|
||||
glDisableVertexAttribArray(ATTRIB_NORMAL);
|
||||
glDisableVertexAttribArray(ATTRIB_WEIGHTS);
|
||||
glDisableVertexAttribArray(ATTRIB_INDICES);
|
||||
glDisableVertexAttribArray(ATTRIB_TEXCOORDS1);
|
||||
|
||||
glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices);
|
||||
|
||||
glDisableVertexAttribArray(ATTRIB_POS);
|
||||
|
|
@ -221,6 +231,11 @@ im3DRenderPrimitive(PrimitiveType primType)
|
|||
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u));
|
||||
|
||||
glDisableVertexAttribArray(ATTRIB_NORMAL);
|
||||
glDisableVertexAttribArray(ATTRIB_WEIGHTS);
|
||||
glDisableVertexAttribArray(ATTRIB_INDICES);
|
||||
glDisableVertexAttribArray(ATTRIB_TEXCOORDS1);
|
||||
|
||||
glDrawArrays(primTypeMap[primType], 0, num3DVertices);
|
||||
|
||||
glDisableVertexAttribArray(ATTRIB_POS);
|
||||
|
|
@ -245,6 +260,11 @@ im3DRenderIndexedPrimitive(PrimitiveType primType, void *indices, int32 numIndic
|
|||
glEnableVertexAttribArray(ATTRIB_TEXCOORDS0);
|
||||
glVertexAttribPointer(ATTRIB_TEXCOORDS0, 2, GL_FLOAT, GL_FALSE, sizeof(Im3DVertex), (uint8*)currentIm3dVertices + OFFSET_OF(Im3DVertex, u));
|
||||
|
||||
glDisableVertexAttribArray(ATTRIB_NORMAL);
|
||||
glDisableVertexAttribArray(ATTRIB_WEIGHTS);
|
||||
glDisableVertexAttribArray(ATTRIB_INDICES);
|
||||
glDisableVertexAttribArray(ATTRIB_TEXCOORDS1);
|
||||
|
||||
glDrawElements(primTypeMap[primType], numIndices, GL_UNSIGNED_SHORT, indices);
|
||||
|
||||
glDisableVertexAttribArray(ATTRIB_POS);
|
||||
|
|
|
|||
1
vendor/librw/src/gl/gl3skin.cpp
vendored
1
vendor/librw/src/gl/gl3skin.cpp
vendored
|
|
@ -342,7 +342,6 @@ skinClose(void *o, int32, int32)
|
|||
void
|
||||
initSkin(void)
|
||||
{
|
||||
if (moreVram) return; // TODO
|
||||
u_boneMatrices = registerUniform("u_boneMatrices", UNIFORM_MAT4, MAX_BONES);
|
||||
|
||||
Driver::registerPlugin(PLATFORM_GL3, 0, ID_SKIN,
|
||||
|
|
|
|||
2
vendor/librw/src/gl/shaders/skin.vert
vendored
2
vendor/librw/src/gl/shaders/skin.vert
vendored
|
|
@ -13,7 +13,7 @@ main(void)
|
|||
SkinVertex += (u_boneMatrices[int(in_indices.x)] * vec4(in_pos, 1.0)).xyz * in_weights.x;
|
||||
SkinVertex += (u_boneMatrices[int(in_indices.y)] * vec4(in_pos, 1.0)).xyz * in_weights.y;
|
||||
SkinVertex += (u_boneMatrices[int(in_indices.z)] * vec4(in_pos, 1.0)).xyz * in_weights.z;
|
||||
SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w;
|
||||
//SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w;
|
||||
|
||||
vec4 Vertex = u_world * vec4(SkinVertex, 1.0);
|
||||
gl_Position = u_proj * u_view * Vertex;
|
||||
|
|
|
|||
2
vendor/librw/src/gl/shaders/skin_gl.inc
vendored
2
vendor/librw/src/gl/shaders/skin_gl.inc
vendored
|
|
@ -14,7 +14,7 @@ const char *skin_vert_src =
|
|||
" SkinVertex += (u_boneMatrices[int(in_indices.x)] * vec4(in_pos, 1.0)).xyz * in_weights.x;\n"
|
||||
" SkinVertex += (u_boneMatrices[int(in_indices.y)] * vec4(in_pos, 1.0)).xyz * in_weights.y;\n"
|
||||
" SkinVertex += (u_boneMatrices[int(in_indices.z)] * vec4(in_pos, 1.0)).xyz * in_weights.z;\n"
|
||||
" SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w;\n"
|
||||
" //SkinVertex += (u_boneMatrices[int(in_indices.w)] * vec4(in_pos, 1.0)).xyz * in_weights.w;\n"
|
||||
|
||||
" vec4 Vertex = u_world * vec4(SkinVertex, 1.0);\n"
|
||||
" gl_Position = u_proj * u_view * Vertex;\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue