mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-08 14:59:16 -04:00
some shader improvements
This commit is contained in:
parent
fd0974055d
commit
14a3257092
@ -117,7 +117,7 @@ void animation_animated(uint animationId) {
|
||||
animationArray2 = animation_extractArray(texture2);
|
||||
animationLayer2 = animation_extractLayer(texture2);
|
||||
|
||||
animationInterpolation = data.z / 100.0f;
|
||||
animationInterpolation = data.z * (1.0f / 100.0f);
|
||||
}
|
||||
|
||||
void setTexture(uint animation) {
|
||||
|
@ -37,6 +37,7 @@ vec4 getTexture(uint textureId, vec3 uv, uint mipmapLevel) {
|
||||
case 7u: return textureLod(uTextures[7], uv, lod);
|
||||
case 8u: return textureLod(uTextures[8], uv, lod);
|
||||
case 9u: return textureLod(uTextures[9], uv, lod);
|
||||
default: return textureLod(uTextures[0], uv, lod);
|
||||
}
|
||||
return textureLod(uTextures[0], uv, lod);
|
||||
#endif
|
||||
@ -63,6 +64,7 @@ vec4 getTexture(uint textureId, vec3 uv) {
|
||||
case 7u: return texture(uTextures[7], uv);
|
||||
case 8u: return texture(uTextures[8], uv);
|
||||
case 9u: return texture(uTextures[9], uv);
|
||||
default: return texture(uTextures[0], uv);
|
||||
}
|
||||
return texture(uTextures[0], uv);
|
||||
#endif
|
||||
|
@ -19,8 +19,8 @@
|
||||
#define UV_UNPACK_MASK ((1u << UV_UNPACK_BITS) - 1u)
|
||||
|
||||
vec2 uv_unpack(uint raw) {
|
||||
float x = float((raw >> (1u * UV_UNPACK_BITS)) & UV_UNPACK_MASK) / float(UV_UNPACK_MASK);
|
||||
float y = float((raw >> (0u * UV_UNPACK_BITS)) & UV_UNPACK_MASK) / float(UV_UNPACK_MASK);
|
||||
float x = float((raw >> (1u * UV_UNPACK_BITS)) & UV_UNPACK_MASK) * (1.0f / float(UV_UNPACK_MASK));
|
||||
float y = float((raw >> (0u * UV_UNPACK_BITS)) & UV_UNPACK_MASK) * (1.0f / float(UV_UNPACK_MASK));
|
||||
|
||||
return vec2(x, y);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user