diff --git a/examples/tests/textureStress.fs b/examples/tests/textureStress.fs index cb59c9984f..fc592234d0 100644 --- a/examples/tests/textureStress.fs +++ b/examples/tests/textureStress.fs @@ -3,35 +3,18 @@ float aspect(vec2 v) { } vec3 aspectCorrectedTexture() { - vec2 uv = _position.xy; + vec2 uv; + + if (abs(_position.y) > 0.4999) { + uv = _position.xz; + } else if (abs(_position.z) > 0.4999) { + uv = _position.xy; + } else { + uv = _position.yz; + } uv += 0.5; uv.y = 1.0 - uv.y; - - float targetAspect = iWorldScale.x / iWorldScale.y; - float sourceAspect = aspect(iChannelResolution[0].xy); - float aspectCorrection = sourceAspect / targetAspect; - if (aspectCorrection > 1.0) { - float offset = aspectCorrection - 1.0; - float halfOffset = offset / 2.0; - uv.y -= halfOffset; - uv.y *= aspectCorrection; - } else { - float offset = 1.0 - aspectCorrection; - float halfOffset = offset / 2.0; - uv.x -= halfOffset; - uv.x /= aspectCorrection; - } - - if (any(lessThan(uv, vec2(0.0)))) { - return vec3(0.0); - } - - if (any(greaterThan(uv, vec2(1.0)))) { - return vec3(0.0); - } - - vec4 color = texture(iChannel0, uv); - return color.rgb * max(0.5, sourceAspect) * max(0.9, fract(iWorldPosition.x)); + return texture(iChannel0, uv).rgb; } float getProceduralColors(inout vec3 diffuse, inout vec3 specular, inout float shininess) { diff --git a/examples/tests/textureStress.js b/examples/tests/textureStress.js index daf6eb41ec..1e3cf9a367 100644 --- a/examples/tests/textureStress.js +++ b/examples/tests/textureStress.js @@ -42,7 +42,7 @@ function createItems(count) { name: TEST_ENTITY_NAME, position: AUSTIN.avatarRelativePosition(AUSTIN.randomPositionXZ({ x: 0, y: 0, z: -2 }, RADIUS)), color: { r: 255, g: 255, b: 255 }, - dimensions: AUSTIN.randomDimensions(), + dimensions: { x: 0.5, y: 0.5, z: 0.5 }, //AUSTIN.randomDimensions(), lifetime: ENTITY_LIFETIME, userData: JSON.stringify({ ProceduralEntity: {