mirror of
https://github.com/lubosz/overte.git
synced 2025-04-19 17:03:43 +02:00
Addressing the 4.1 pass and make sure it works on windows pc and mac
This commit is contained in:
parent
305ea80a18
commit
c12115bfda
1 changed files with 11 additions and 6 deletions
|
@ -39,16 +39,21 @@ vec3 unpackSnorm3x10_1x2(int packedX10Y10Z10A2) {
|
|||
#if defined(GPU_GL410)
|
||||
layout(binding=0) uniform samplerBuffer blendshapeOffsetsBuffer;
|
||||
BlendshapeOffset getBlendshapeOffset(int i) {
|
||||
int offset = 3 * i;
|
||||
BlendshapeOffset blendshapeOffset;
|
||||
blendshapeOffset.position = texelFetch(blendshapeOffsetsBuffer, offset);
|
||||
vec4 fetched = texelFetch(blendshapeOffsetsBuffer, i);
|
||||
ivec4 elem_packed = ivec4(floatBitsToUint(fetched.x), floatBitsToUint(fetched.y), floatBitsToUint(fetched.z), floatBitsToUint(fetched.w));
|
||||
|
||||
BlendshapeOffset unpacked;
|
||||
vec2 pZnZ = unpackHalf2x16(uint(elem_packed.y));
|
||||
unpacked.position = vec3(unpackHalf2x16(uint(elem_packed.x)), pZnZ.x);
|
||||
<@if USE_NORMAL@>
|
||||
blendshapeOffset.normal = texelFetch(blendshapeOffsetsBuffer, offset + 1);
|
||||
unpacked.normal = vec3(unpackHalf2x16(uint(elem_packed.z)), pZnZ.y);
|
||||
//unpacked.normal = unpackSnorm3x10_1x2((elem_packed.z)).xyz;
|
||||
<@endif@>
|
||||
<@if USE_TANGENT@>
|
||||
blendshapeOffset.tangent = texelFetch(blendshapeOffsetsBuffer, offset + 2);
|
||||
unpacked.tangent = unpackSnorm3x10_1x2((elem_packed.w)).xyz;
|
||||
<@endif@>
|
||||
return blendshapeOffset;
|
||||
|
||||
return unpacked;
|
||||
}
|
||||
#else
|
||||
layout(std140, binding=0) buffer blendshapeOffsetsBuffer {
|
||||
|
|
Loading…
Reference in a new issue