mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-09-11 21:37:46 -04:00
Some small fixes.
- Weird alignment issues when using *align(8)Vec3d - Duplicate dFdx
This commit is contained in:
parent
4769e9cb52
commit
b84332d426
@ -171,16 +171,11 @@ float getLod(ivec3 voxelPosition, int normal, vec3 direction, float variance) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
float perpendicularFwidth(vec3 direction) { // Estimates how big fwidth would be if the fragment normal was perpendicular to the light direction.
|
float perpendicularFwidth(vec3 direction) { // Estimates how big fwidth would be if the fragment normal was perpendicular to the light direction.
|
||||||
vec3 varianceX = dFdx(direction);
|
vec3 variance = dFdx(direction);
|
||||||
vec3 varianceY = dFdx(direction);
|
variance += direction;
|
||||||
varianceX += direction;
|
variance = variance*length(direction)/length(variance);
|
||||||
varianceX = varianceX*length(direction)/length(varianceX);
|
variance -= direction;
|
||||||
varianceX -= direction;
|
return 16*length(variance);
|
||||||
varianceY += direction;
|
|
||||||
varianceY = varianceY*length(direction)/length(varianceY);
|
|
||||||
varianceY -= direction;
|
|
||||||
vec3 variance = abs(varianceX) + abs(varianceY);
|
|
||||||
return 8*length(variance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 mipMapSample(sampler2DArray texture, ivec2 textureCoords, int textureIndex, float lod) { // TODO: anisotropic filtering?
|
vec4 mipMapSample(sampler2DArray texture, ivec2 textureCoords, int textureIndex, float lod) { // TODO: anisotropic filtering?
|
||||||
|
@ -453,7 +453,7 @@ pub const ClientItemDropManager = struct {
|
|||||||
|
|
||||||
timeDifference: utils.TimeDifference = .{},
|
timeDifference: utils.TimeDifference = .{},
|
||||||
|
|
||||||
interpolation: utils.GenericInterpolation(maxf64Capacity) = undefined,
|
interpolation: utils.GenericInterpolation(maxf64Capacity)align(32) = undefined, // TODO: Remove align(32) after #14527
|
||||||
|
|
||||||
var instance: ?*ClientItemDropManager = null;
|
var instance: ?*ClientItemDropManager = null;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user