-
Notifications
You must be signed in to change notification settings - Fork 22
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
65 changed files
with
557 additions
and
160 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 |
---|---|---|
@@ -1 +1 @@ | ||
{"topColor":[1,0.92,0.81,0.3],"midColor":[1,0.91,0.82,0.19],"bottomColor":[1,0.91,0.82,0.1],"pointLights":[{"label":"SunLight","position":[-2.0100000000000007,1.05,-3],"size":4,"color":[0.9247851371765137,0.7160086368313046,0.3467944264411926,1],"strength":22.68,"castShadow":true,"numShadowSamples":32,"shadowScale":0.63,"sizeMesh":0.22,"showLightMesh":true},{"label":"BlueLight","position":[1.6200000000000017,0.5799999999999998,-2.269999999999997],"size":3.09,"color":[0.0587158203125,0.6401400566101074,0.939453125,1],"strength":10,"castShadow":false,"numShadowSamples":10,"shadowScale":1,"sizeMesh":0.05,"showLightMesh":false},{"label":"GreenLight","position":[-0.5900000000000005,-0.4500000000000004,-0.3700000000000016],"size":1.46,"color":[0.41641953587532043,0.833984375,0.32251739501953125,1],"strength":10,"castShadow":false,"numShadowSamples":3,"shadowScale":1,"sizeMesh":0.05,"showLightMesh":false}]} | ||
{"topColor":[1,0.92,0.81,0.3],"midColor":[1,0.91,0.82,0.19],"bottomColor":[1,0.91,0.82,0.1],"pointLights":[{"label":"SunLight","position":[-2.0100000000000007,1.05,-1.7700000000000025],"size":4,"color":[0.9247851371765137,0.7160086368313046,0.3467944264411926,1],"strength":22.68,"castShadow":true,"numShadowSamples":32,"shadowScale":0.63,"sizeMesh":0.22,"showLightMesh":true},{"label":"BlueLight","position":[1.6200000000000017,0.29999999999999927,-1.9199999999999953],"size":3.09,"color":[0.0587158203125,0.6401400566101074,0.939453125,1],"strength":10,"castShadow":false,"numShadowSamples":10,"shadowScale":1,"sizeMesh":0.05,"showLightMesh":false},{"label":"GreenLight","position":[-0.5900000000000005,-0.4500000000000004,-0.3700000000000016],"size":1.46,"color":[0.41641953587532043,0.833984375,0.32251739501953125,1],"strength":10,"castShadow":false,"numShadowSamples":3,"shadowScale":1,"sizeMesh":0.05,"showLightMesh":false}]} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
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
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,66 @@ | ||
import RenderPass from "./lib/core/RenderPass"; | ||
import UI from "./lib/UI/UI"; | ||
|
||
class RenderSettings{ | ||
private passes:Array<RenderPass>=[]; | ||
public bloom_threshold: number=1; | ||
public bloom_softThreshold:number=0.2; | ||
|
||
|
||
public exposure=1; | ||
public contrast =1; | ||
public brightness:number =0; | ||
public vibrance:number=0; | ||
public saturation:number =0 | ||
public vin_amount: number =0.5; | ||
public vin_falloff: number=0.4; | ||
public bloom_strength: number =1; | ||
|
||
|
||
|
||
constructor() { | ||
|
||
} | ||
registerPass(pass:RenderPass){ | ||
this.passes.push(pass); | ||
} | ||
onChange() | ||
{ | ||
for(let p of this.passes) | ||
{ | ||
p.onSettingsChange() | ||
} | ||
|
||
} | ||
onUI(){ | ||
UI.pushGroup("Bloom"); | ||
this.bloom_threshold =UI.LFloatSlider("Threshold",this.bloom_threshold,0,20) | ||
this.bloom_softThreshold =UI.LFloatSlider("SoftThreshold",this.bloom_softThreshold,0,1) | ||
this.bloom_strength =UI.LFloatSlider("Strength", this.bloom_strength,0,5) | ||
UI.popGroup() | ||
|
||
UI.pushGroup("Post"); | ||
this.exposure=UI.LFloatSlider("Exposure",this.exposure,0,10); | ||
this.brightness=UI.LFloatSlider("Brightness",this.brightness,-1,1); | ||
this.contrast=UI.LFloatSlider("Contrast",this.contrast,0,2); | ||
|
||
this.vibrance=UI.LFloatSlider("Vibrance",this.vibrance,-1,1); | ||
this.saturation=UI.LFloatSlider("Saturation",this.saturation,-1,1); | ||
|
||
UI.separator("Vignette"); | ||
this.vin_amount=UI.LFloatSlider("Amount",this.vin_amount,0,1); | ||
this.vin_falloff=UI.LFloatSlider("Falloff",this.vin_falloff,0,1); | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
UI.popGroup() | ||
this.onChange(); | ||
|
||
} | ||
|
||
} | ||
export default new RenderSettings() |
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
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,64 @@ | ||
import Renderer from "../lib/Renderer"; | ||
import RenderTexture from "../lib/textures/RenderTexture"; | ||
import {TextureFormat} from "../lib/WebGPUConstants"; | ||
import KawasePass from "./KawasePass"; | ||
import RenderPass from "../lib/core/RenderPass"; | ||
|
||
export default class BlurBloom { | ||
private renderer: Renderer; | ||
private numLevels =6; | ||
private result: RenderTexture; | ||
private targetTextures: Array<RenderTexture> = [] | ||
private passes: Array<RenderPass> = [] | ||
|
||
constructor(renderer: Renderer) { | ||
this.renderer = renderer; | ||
|
||
let start = this.renderer.texturesByLabel["BloomPrePass"] as RenderTexture | ||
this.result = new RenderTexture(renderer, "BlurBloomPass", | ||
{ | ||
scaleToCanvas: true, sizeMultiplier: 0.5, format: TextureFormat.RGBA16Float, | ||
mipLevelCount: this.numLevels, | ||
usage: GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.COPY_DST | ||
}) | ||
let scale = 1; | ||
this.targetTextures.push(start); | ||
for (let i = 0; i < this.numLevels; i++) { | ||
scale *= 0.5; | ||
let label= "BlurBloomLevel" + i; | ||
if(i==0){ | ||
label ="BlurBloom"; | ||
} | ||
let t = new RenderTexture(renderer, label, | ||
{ | ||
scaleToCanvas: true, | ||
sizeMultiplier: scale, | ||
format: TextureFormat.RGBA16Float, | ||
usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING | ||
}) | ||
this.targetTextures.push(t); | ||
let kawasePass = new KawasePass(renderer, t, this.targetTextures[i]); | ||
this.passes.push(kawasePass); | ||
} | ||
|
||
for (let i = this.numLevels-1;i>0; i--) { | ||
console.log(this.numLevels,i,this.targetTextures[i+1].label, this.targetTextures[i].label) | ||
|
||
let kawasePass = new KawasePass(renderer, this.targetTextures[i], this.targetTextures[i+1],false,true); | ||
this.passes.push(kawasePass); | ||
} | ||
|
||
} | ||
|
||
public add() { | ||
for (let pass of this.passes) { | ||
pass.add(); | ||
|
||
} | ||
|
||
|
||
|
||
} | ||
|
||
|
||
} |
Oops, something went wrong.