提交 3f58f03c 编写于 作者: A alteredq

Added color correction shader to ShaderExtras

上级 5dc4bcc1
......@@ -21,6 +21,7 @@
* blend
* fxaa
* luminosity
* colorCorrection
* normalmap
*/
......@@ -1282,6 +1283,53 @@ THREE.ShaderExtras = {
},
/* -------------------------------------------------------------------------
// Color correction
------------------------------------------------------------------------- */
'colorCorrection': {
uniforms: {
"tDiffuse" : { type: "t", value: 0, texture: null },
"powRGB" : { type: "v3", value: new THREE.Vector3( 2, 2, 2 ) },
"mulRGB" : { type: "v3", value: new THREE.Vector3( 1, 1, 1 ) }
},
vertexShader: [
"varying vec2 vUv;",
"void main() {",
"vUv = vec2( uv.x, 1.0 - uv.y );",
"gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );",
"}"
].join("\n"),
fragmentShader: [
"uniform sampler2D tDiffuse;",
"uniform vec3 powRGB;",
"uniform vec3 mulRGB;",
"varying vec2 vUv;",
"void main() {",
"gl_FragColor = texture2D( tDiffuse, vUv );",
"gl_FragColor.rgb = mulRGB * pow( gl_FragColor.rgb, powRGB );",
"}"
].join("\n")
},
/* -------------------------------------------------------------------------
// Normal map shader
// - compute normals from heightmap
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册