mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 07:22:43 +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;
|
||||
|
||||
vec3 unpackSnorm3x10_1x2(int packed) {
|
||||
vec4 _unpacked = vec4(
|
||||
clamp( float( bitfieldExtract(packed, 0, 10)) * oneOver511, -1.0, 1.0),
|
||||
clamp( float( bitfieldExtract(packed, 10, 10)) * oneOver511, -1.0, 1.0),
|
||||
clamp( float( bitfieldExtract(packed, 20, 10)) * oneOver511, -1.0, 1.0),
|
||||
0.0
|
||||
vec3 unpackSnorm3x10_1x2(int packedValue) {
|
||||
return vec3(
|
||||
clamp( float( bitfieldExtract(packedValue, 0, 10)) * oneOver511, -1.0, 1.0),
|
||||
clamp( float( bitfieldExtract(packedValue, 10, 10)) * oneOver511, -1.0, 1.0),
|
||||
clamp( float( bitfieldExtract(packedValue, 20, 10)) * oneOver511, -1.0, 1.0)
|
||||
);
|
||||
return _unpacked.xyz;
|
||||
}
|
||||
|
||||
#if defined(GPU_GL410)
|
||||
layout(binding=0) uniform samplerBuffer blendshapeOffsetsBuffer;
|
||||
|
||||
vec2 gpu_unpackHalf2x16(uint packed) {
|
||||
return unpackHalf2x16(packed);
|
||||
vec2 gpu_unpackHalf2x16(uint packedValue) {
|
||||
return unpackHalf2x16(packedValue);
|
||||
}
|
||||
|
||||
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() {
|
||||
QVector<BlendshapeOffset> blendshapeOffsets;
|
||||
|
@ -1678,15 +1678,6 @@ void Blender::run() {
|
|||
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) {
|
||||
nx = (x / Window.innerWidth);
|
||||
ny = 1.0 - ((y) / (Window.innerHeight - 32));
|
||||
nx = 2.0 * (x / Window.innerWidth) - 1.0;
|
||||
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