false

Just finished working on day night cycle and added flexible post processing pipeline. I just need to edit simple json that defines framebuffers and steps with information about uniforms and shaders:

{ buffers: [ { width: 512, height: 512, format: "RGB888", filter: "Linear", wrap: "MirroredRepeat", depth: false, name: "my:small-color" }, { width: 512, height: 512, format: "RGB888", filter: "Linear", wrap: "ClampToEdge", depth: false, name: "my:blur" }, { width: 256, height: 256, format: "RGBA8888", filter: "Linear", wrap: "ClampToEdge", depth: false, name: "my:light-scattering-assembler" } { width: 256, height: 256, format: "RGBA8888", filter: "Linear", wrap: "ClampToEdge", depth: false, name: "my:light-scattering" }, ], steps: [ { copy: "forge:main-color", target: "my:small-color" }, { target: "my:light-scattering-assembler", fragment: "prepare-light-scattering-texture", customUniforms: { u_depthTexture: "forge:depth", u_sunTexture: "forge:sun" }, helpers: { vertex: [], fragment: ["shadow_map"] }, }, { target: "my:light-scattering", fragment: "light-scattering", customUniforms: { u_mainTexture: "my:light-scattering-assembler", u_density: 0.87, u_weight: 5.60, u_exposure: 0.0014, u_decay: 1.0, u_numSamples: 70 }, uniforms: [ "LightPositionOnScreen" ] }, { target: "my:blur", fragment: "blur", customUniforms: { u_mainTexture: "my:small-color", u_blurPower: 0.003 }, }, { fragment: "final", target: "forge:final-color", uniforms: [ "VignetteTexture" ], customUniforms: { u_mainTexture: "forge:main-color", u_blurTexture: "my:blur", u_lightScatteringTexture: "my:light-scattering", u_blurMix: 0.25 } } ] }

Final result:

https://www.youtube.com/watch?v=dICr1aKgz4o

Source code

  • Last update: ( over 1 year ago )
  • Size: 30.9 KB

Comments