ugly-game 0.15.53 → 0.15.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/gpuProps.js +11 -1
- package/package.json +2 -1
package/dist/assets/gpuProps.js
CHANGED
|
@@ -211,7 +211,17 @@ fn studioEnv(r: vec3<f32>, rough: f32) -> vec3<f32> {
|
|
|
211
211
|
fn environment(r: vec3<f32>, rough: f32) -> vec3<f32> {
|
|
212
212
|
if (mtl.coat.z < 0.5) { return studioEnv(r,rough); }
|
|
213
213
|
let uv=vec2(atan2(r.z,r.x)/6.2831853+0.5,acos(clamp(r.y,-1.0,1.0))/3.14159265);
|
|
214
|
-
|
|
214
|
+
// Roughness alone under-filters glossy curved surfaces: one screen pixel can
|
|
215
|
+
// span many environment texels, making chrome/clearcoat flash while orbiting.
|
|
216
|
+
// Respect that footprint as well as the material's prefiltered reflection.
|
|
217
|
+
// Longitude wraps at the panorama seam; unwrap its derivatives so crossing
|
|
218
|
+
// that seam does not introduce a spurious blurry stripe.
|
|
219
|
+
let dx=dpdx(uv); let dy=dpdy(uv);
|
|
220
|
+
let dimensions=vec2<f32>(textureDimensions(environmentTex));
|
|
221
|
+
let sx=vec2(dx.x-round(dx.x),dx.y)*dimensions;
|
|
222
|
+
let sy=vec2(dy.x-round(dy.x),dy.y)*dimensions;
|
|
223
|
+
let pixelLod=log2(max(1.0,max(length(sx),length(sy))));
|
|
224
|
+
return textureSampleLevel(environmentTex,albedoSamp,uv,max(rough*mtl.coat.w,pixelLod)).rgb;
|
|
215
225
|
}
|
|
216
226
|
fn fresnel(f0: vec3<f32>, cosTheta: f32) -> vec3<f32> {
|
|
217
227
|
return f0 + (vec3(1.0) - f0) * pow(1.0 - clamp(cosTheta, 0.0, 1.0), 5.0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ugly-game",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.54",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"test": "node --experimental-strip-types --import ./tools/tsResolve.mjs --test src/*.test.mts && pnpm run test:gpu-skin",
|
|
24
24
|
"test:flight": "node --experimental-strip-types --import ./tools/tsResolve.mjs --test src/flight*.test.mts",
|
|
25
25
|
"test:flight-browser": "playwright test -c playwright.flight.config.ts",
|
|
26
|
+
"test:props-browser": "playwright test -c playwright.props.config.ts",
|
|
26
27
|
"test:flight-perf": "playwright test -c playwright.flight.config.ts --grep 'CPU and retained-memory'",
|
|
27
28
|
"test:types": "tsc -p tsconfig.test.json",
|
|
28
29
|
"test:package-types": "node tools/packageTypesSmoke.mjs",
|