kfeditor better light

This commit is contained in:
STEINNI
2025-10-29 18:47:48 +00:00
parent dfab013abe
commit af23d09aa2
4 changed files with 53 additions and 9 deletions
@@ -0,0 +1,43 @@
/**
* Gamma Correction Shader
* http://en.wikipedia.org/wiki/gamma_correction
*/
const GammaCorrectionShader = {
name: 'GammaCorrectionShader',
uniforms: {
'tDiffuse': { value: null }
},
vertexShader: /* glsl */`
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,
fragmentShader: /* glsl */`
uniform sampler2D tDiffuse;
varying vec2 vUv;
void main() {
vec4 tex = texture2D( tDiffuse, vUv );
gl_FragColor = sRGBTransferOETF( tex );
}`
};
export { GammaCorrectionShader };
+2 -3
View File
@@ -206,11 +206,10 @@ export class Threetobus{
this.cameras.cam2Dtop.layers.enable(1)
// Lights
const light = new THREE.DirectionalLight(0xffffff, 1)
const light = new THREE.DirectionalLight(0xffffff, 2)
light.position.set(5, 5, 5)
light.intensity = 2
this.scene.add(light)
this.scene.add(new THREE.AmbientLight(0xffffff, 0.4))
this.scene.add(new THREE.AmbientLight(0xffffff, 1))
}