mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 18:10:37 +02:00
Check and fixed the shader for nvidia regarding the unpacked variable name, adjust luci.js to be able to move the viewport
This commit is contained in:
parent
c593f00839
commit
d1d4920c35
3 changed files with 11 additions and 22 deletions
|
@ -26,21 +26,19 @@ struct BlendshapeOffset {
|
||||||
|
|
||||||
const float oneOver511 = 1.0 / 511.0;
|
const float oneOver511 = 1.0 / 511.0;
|
||||||
|
|
||||||
vec3 unpackSnorm3x10_1x2(int packed) {
|
vec3 unpackSnorm3x10_1x2(int packedValue) {
|
||||||
vec4 _unpacked = vec4(
|
return vec3(
|
||||||
clamp( float( bitfieldExtract(packed, 0, 10)) * oneOver511, -1.0, 1.0),
|
clamp( float( bitfieldExtract(packedValue, 0, 10)) * oneOver511, -1.0, 1.0),
|
||||||
clamp( float( bitfieldExtract(packed, 10, 10)) * oneOver511, -1.0, 1.0),
|
clamp( float( bitfieldExtract(packedValue, 10, 10)) * oneOver511, -1.0, 1.0),
|
||||||
clamp( float( bitfieldExtract(packed, 20, 10)) * oneOver511, -1.0, 1.0),
|
clamp( float( bitfieldExtract(packedValue, 20, 10)) * oneOver511, -1.0, 1.0)
|
||||||
0.0
|
|
||||||
);
|
);
|
||||||
return _unpacked.xyz;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(GPU_GL410)
|
#if defined(GPU_GL410)
|
||||||
layout(binding=0) uniform samplerBuffer blendshapeOffsetsBuffer;
|
layout(binding=0) uniform samplerBuffer blendshapeOffsetsBuffer;
|
||||||
|
|
||||||
vec2 gpu_unpackHalf2x16(uint packed) {
|
vec2 gpu_unpackHalf2x16(uint packedValue) {
|
||||||
return unpackHalf2x16(packed);
|
return unpackHalf2x16(packedValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
BlendshapeOffset getBlendshapeOffset(int i) {
|
BlendshapeOffset getBlendshapeOffset(int i) {
|
||||||
|
|
|
@ -1633,7 +1633,7 @@ Blender::Blender(ModelPointer model, int blendNumber, const Geometry::WeakPointe
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//#define DEBUG_PACKED_BLENDSHAPE_OFFSET 1
|
#define DEBUG_PACKED_BLENDSHAPE_OFFSET 1
|
||||||
|
|
||||||
void Blender::run() {
|
void Blender::run() {
|
||||||
QVector<BlendshapeOffset> blendshapeOffsets;
|
QVector<BlendshapeOffset> blendshapeOffsets;
|
||||||
|
@ -1678,15 +1678,6 @@ void Blender::run() {
|
||||||
currentBlendshapeOffset.tangentOffsetAndSpare += blendshape.tangents.at(j) * normalCoefficient;
|
currentBlendshapeOffset.tangentOffsetAndSpare += blendshape.tangents.at(j) * normalCoefficient;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG_PACKED_BLENDSHAPE_OFFSET
|
|
||||||
if (glm::any(glm::greaterThan(glm::abs(currentBlendshapeOffset.normalOffsetAndSpare), glm::vec3(1.0f)))) {
|
|
||||||
currentBlendshapeOffset.normalOffsetAndSpare = glm::clamp(currentBlendshapeOffset.normalOffsetAndSpare, glm::vec3(-1.0f), glm::vec3(1.0f));
|
|
||||||
}
|
|
||||||
if (glm::any(glm::greaterThan(glm::abs(currentBlendshapeOffset.tangentOffsetAndSpare), glm::vec3(1.0f)))) {
|
|
||||||
currentBlendshapeOffset.tangentOffsetAndSpare = glm::clamp(currentBlendshapeOffset.tangentOffsetAndSpare, glm::vec3(-1.0f), glm::vec3(1.0f));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,10 +81,10 @@
|
||||||
|
|
||||||
|
|
||||||
function setDebugCursor(x, y) {
|
function setDebugCursor(x, y) {
|
||||||
nx = (x / Window.innerWidth);
|
nx = 2.0 * (x / Window.innerWidth) - 1.0;
|
||||||
ny = 1.0 - ((y) / (Window.innerHeight - 32));
|
ny = 1.0 - 2.0 * ((y) / (Window.innerHeight));
|
||||||
|
|
||||||
Render.getConfig("RenderMainView").getConfig("Antialiasing").debugCursorTexcoord = { x: nx, y: ny };
|
Render.getConfig("RenderMainView").getConfig("DebugDeferredBuffer").size = { x: nx, y: ny, z: 1.0, w: 1.0 };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue