Procházet zdrojové kódy

Tonemap, Gbuffer fix.

master
Palash Bansal před 2 roky
rodič
revize
833fa3e7c6
Žádný účet není propojen s e-mailovou adresou tvůrce revize

+ 2
- 1
src/plugins/pipeline/DepthBufferPlugin.ts Zobrazit soubor

@@ -104,7 +104,8 @@ export class DepthBufferPlugin
this.target = this._viewer.renderManager.createTarget<DepthBufferPluginTarget>(
{
depthBuffer: true,
samples: this._viewer.renderManager.composerTarget.samples || 0,
samples: this._viewer.renderManager.zPrepass && this.isPrimaryGBuffer ? // requirement for zPrepass
this._viewer.renderManager.composerTarget.samples || 0 : 0,
type: this.bufferType,
// magFilter: NearestFilter,
// minFilter: NearestFilter,

+ 5
- 1
src/plugins/pipeline/GBufferPlugin.ts Zobrazit soubor

@@ -1,6 +1,7 @@
import {
BufferGeometry,
Camera,
ClampToEdgeWrapping,
Color,
DepthTexture,
DoubleSide,
@@ -148,7 +149,8 @@ export class GBufferPlugin
this.target = this._viewer.renderManager.createTarget<GBufferPluginTarget>(
{
depthBuffer: true,
samples: this._viewer.renderManager.composerTarget.samples || 0,
samples: this._viewer.renderManager.zPrepass && this.isPrimaryGBuffer ? // requirement for zPrepass
this._viewer.renderManager.composerTarget.samples || 0 : 0,
type: this.bufferType,
textureCount: useMultiple ? 2 : 1,
depthTexture: this.renderDepthTexture,
@@ -157,6 +159,8 @@ export class GBufferPlugin
// minFilter: NearestFilter,
// generateMipmaps: false,
// encoding: LinearEncoding,
wrapS: ClampToEdgeWrapping,
wrapT: ClampToEdgeWrapping,
})
if (Array.isArray(this.target.texture)) {
this.target.texture[0].name = 'gbufferDepthNormal'

+ 3
- 1
src/plugins/postprocessing/shaders/TonemapPlugin.patch.glsl Zobrazit soubor

@@ -1,8 +1,10 @@
bool doTonemap = true;
#ifdef HAS_GBUFFER
#ifdef GBUFFER_HAS_FLAGS
doTonemap = getToneMapBit(getGBufferFlags(vUv).a) > 0;
#endif
#if TONEMAP_BACKGROUND < 1
if(isBackground) doTonemap = false;
if(isBackground) doTonemap = false; // isBackground defined in ScreenPass
#endif
#endif
if(doTonemap) diffuseColor = ToneMapping(diffuseColor);

Načítá se…
Zrušit
Uložit