Before moving boneSelector from unsigned complete
- boneSelector being unsigned might be the reason why gles is having a hard time. Just stashing this commit here as a bookmark in case I need it
This commit is contained in:
parent
13edabac19
commit
ee7c467a17
5 changed files with 96 additions and 10 deletions
|
|
@ -38,6 +38,7 @@
|
|||
#include "shaderuniforms.h"
|
||||
#include "hw_viewpointuniforms.h"
|
||||
#include "hw_lightbuffer.h"
|
||||
#include "hw_bonebuffer.h"
|
||||
#include "i_specialpaths.h"
|
||||
#include "printf.h"
|
||||
#include "version.h"
|
||||
|
|
@ -321,6 +322,12 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char *
|
|||
// dynamic lights
|
||||
uniform ivec4 uLightRange;
|
||||
|
||||
// bone animation
|
||||
uniform int uBoneIndexBase;
|
||||
|
||||
// bone matrix buffers
|
||||
uniform mat4 bones[NUM_UBO_BONES];
|
||||
|
||||
// Blinn glossiness and specular level
|
||||
uniform vec2 uSpecularMaterial;
|
||||
|
||||
|
|
@ -391,10 +398,11 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char *
|
|||
FString vp_comb;
|
||||
|
||||
assert(screen->mLights != NULL);
|
||||
assert(screen->mBones != NULL);
|
||||
|
||||
unsigned int lightbuffersize = screen->mLights->GetBlockSize();
|
||||
|
||||
vp_comb.Format("#version 100\n#define NUM_UBO_LIGHTS %d\n#define NO_CLIPDISTANCE_SUPPORT\n", lightbuffersize);
|
||||
vp_comb.Format("#version 100\n#define NUM_UBO_LIGHTS %d\n#define NO_CLIPDISTANCE_SUPPORT\n#define NUM_UBO_BONES %d\n", lightbuffersize, screen->mBones->GetBlockSize());
|
||||
|
||||
FString fp_comb = vp_comb;
|
||||
vp_comb << defines << i_data.GetChars();
|
||||
|
|
@ -529,6 +537,8 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char *
|
|||
glBindAttribLocation(shaderData->hShader, VATTR_VERTEX2, "aVertex2");
|
||||
glBindAttribLocation(shaderData->hShader, VATTR_NORMAL, "aNormal");
|
||||
glBindAttribLocation(shaderData->hShader, VATTR_NORMAL2, "aNormal2");
|
||||
glBindAttribLocation(shaderData->hShader, VATTR_BONEWEIGHT, "aBoneWeight");
|
||||
glBindAttribLocation(shaderData->hShader, VATTR_BONESELECTOR, "aBoneSelector");
|
||||
|
||||
|
||||
glLinkProgram(shaderData->hShader);
|
||||
|
|
@ -591,6 +601,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char *
|
|||
shaderData->muLightParms.Init(shaderData->hShader, "uLightAttr");
|
||||
shaderData->muClipSplit.Init(shaderData->hShader, "uClipSplit");
|
||||
shaderData->muLightRange.Init(shaderData->hShader, "uLightRange");
|
||||
shaderData->muBoneIndexBase.Init(shaderData->hShader, "uBoneIndexBase");
|
||||
shaderData->muFogColor.Init(shaderData->hShader, "uFogColor");
|
||||
shaderData->muDynLightColor.Init(shaderData->hShader, "uDynLightColor");
|
||||
shaderData->muObjectColor.Init(shaderData->hShader, "uObjectColor");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue