forked from galacean/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
141 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/** | ||
* @title LUT Test | ||
* @category Material | ||
*/ | ||
import { Camera, Material, MeshRenderer, PrimitiveMesh, Shader, Vector3, WebGLEngine } from "@galacean/engine"; | ||
import { initScreenshot, updateForE2E } from "./.mockForE2E"; | ||
|
||
// Create engine | ||
WebGLEngine.create({ canvas: "canvas" }) | ||
.then((engine) => { | ||
engine.canvas.resizeByClientSize(2); | ||
|
||
const scene = engine.sceneManager.activeScene; | ||
const rootEntity = scene.createRootEntity(); | ||
// engine.run(); | ||
|
||
// Create camera | ||
const cameraEntity = rootEntity.createChild("Camera"); | ||
cameraEntity.transform.position = new Vector3(0, 0, 3); | ||
const camera = cameraEntity.addComponent(Camera); | ||
|
||
const entity = rootEntity.createChild("Entity"); | ||
entity.transform.setRotation(90, 0, 0); | ||
const renderer = entity.addComponent(MeshRenderer); | ||
renderer.mesh = PrimitiveMesh.createPlane(engine, 1, 1); | ||
|
||
const shader = Shader.create( | ||
"LUT-test", | ||
` | ||
attribute vec3 POSITION; | ||
attribute vec2 TEXCOORD_0; | ||
uniform mat4 renderer_MVPMat; | ||
varying vec2 v_uv; | ||
void main(){ | ||
gl_Position = renderer_MVPMat * vec4(POSITION, 1.0); | ||
v_uv = TEXCOORD_0; | ||
}`, | ||
` | ||
varying vec2 v_uv; | ||
uniform sampler2D scene_PrefilteredDFG; | ||
void main(){ | ||
gl_FragColor = texture2D(scene_PrefilteredDFG, v_uv); | ||
} | ||
` | ||
); | ||
const material = new Material(engine, shader); | ||
renderer.setMaterial(material); | ||
updateForE2E(engine); | ||
initScreenshot(engine, camera); | ||
}) | ||
.catch((e) => { | ||
console.log(e); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { ContentRestorer } from "../../asset/ContentRestorer"; | ||
import { Logger } from "../../base"; | ||
import { Engine } from "../../Engine"; | ||
import { TextureFormat, TextureWrapMode } from "../../texture"; | ||
import { Texture2D } from "../../texture/Texture2D"; | ||
|
||
export class PrefilteredDFG { | ||
private static _size = 256; | ||
private static _base64 = `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAAAABGdBTUEAALGPC/xhBQAACjVpQ0NQc1JHQiBJRUM2MTk2Ni0yLjEAAEjHnZZ3VFTXFofPvXd6oc0w0hl6ky4wgPQuIB0EURhmBhjKAMMMTWyIqEBEEREBRZCggAGjoUisiGIhKKhgD0gQUGIwiqioZEbWSnx5ee/l5ffHvd/aZ+9z99l7n7UuACRPHy4vBZYCIJkn4Ad6ONNXhUfQsf0ABniAAaYAMFnpqb5B7sFAJC83F3q6yAn8i94MAUj8vmXo6U+ng/9P0qxUvgAAyF/E5mxOOkvE+SJOyh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qvxk8HXZFIR2hTQAgte9SsVtgtkcu2KfiGweg/3o1AWC9JQrPAMCu/7rLp0yyUvR5jAH4eSL9y4PadtD6JLjqfhdEf7OQVxVS9LsG4NVV/a8GGNzOZYCR9A8LbdDRp6Sc6vv9ZfkW9VkA0KJPxe8dgFdzXzfL/dDNDDBdh978rE9IewcS+FP0eVQD8PIq+uGDm7mZwFIzdNP/nLC2h1LdpuLz2Abgp6viX14BeHkFYDYJHLcAmP5VJfhWc5XJSdHnwQPARfEvBhi8mPRDDws1wBGw/1N1F8t6S6fI3GuSx34B+PGq+BeDBy+ujaCb1d24I2D0W7vBXxXpU/F5UAH4YSD689fzAQz9aGwpA4z6P0trz/BpLlDZqfs8OAF4fv16MXj8ctIM3VT/0sCr1E9wU+55KAHwfSnPrqJ/dn38bADAzWQSPN19WBn0nir7Oan4PFQBeHLV/dPB92eDOrjPAMcBALMffDJqd5a5jn6pNzx55CEIwHevRX/5+t/g+wiA4+TmL2CfJ71NHq4BePxa8Zev/w6+P7/bBRranhOgzC2VPfs88jAD4Kz4/1y/91/PJzPglZBfVdTmkYevIvjfpfz6+qt/8OtrAIaN/6Wmfhr6PGID8NdS/jX4+uf1+7PJX79Lb5NHgwD8vZR/lPLL9fsv18dPwbVsHnkEBuBvA+kPGXia/3fy2AMAfxjcCjP8fsz/O3k0f/wfg5rUWhyQPr4AAAAASUVORK5CYII=`; | ||
|
||
static create(engine: Engine): Promise<Texture2D> { | ||
return new Promise((resolve, reject) => { | ||
const texture = new Texture2D(engine, PrefilteredDFG._size, PrefilteredDFG._size, TextureFormat.R8G8B8, false); | ||
texture.wrapModeU = texture.wrapModeV = TextureWrapMode.Clamp; | ||
texture.isGCIgnored = true; | ||
|
||
const image = new Image(); | ||
|
||
image.onload = () => { | ||
texture.setImageSource(image); | ||
resolve(texture); | ||
}; | ||
|
||
image.onerror = image.onabort = () => { | ||
const message = "Failed to load prefiltered LUT image."; | ||
Logger.error(message); | ||
reject(message); | ||
}; | ||
|
||
image.src = PrefilteredDFG._base64; | ||
|
||
engine.resourceManager.addContentRestorer( | ||
new (class extends ContentRestorer<Texture2D> { | ||
constructor() { | ||
super(texture); | ||
} | ||
restoreContent() { | ||
texture.setImageSource(image); | ||
} | ||
})() | ||
); | ||
|
||
return texture; | ||
}); | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.