Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

354 cleanup postprocessing #371

Merged
merged 33 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
48f0495
docs: add question comments to source
vorg Apr 9, 2024
9e8d29b
refactor: give better names for renderPipeline shadowmapping methods
vorg Apr 18, 2024
9d0e369
refactor: inject shadowmapping methods on top of renderPopeline object
vorg Apr 18, 2024
ef258ca
refactor: start moving postprocessing into render pipeline
vorg Apr 23, 2024
4e3cf10
refactor: finish moving from post-processing renderer to render pipeline
vorg Apr 23, 2024
422cf77
Merge commit 'b8da9848f05a567618f13afbfe2f2b9996ce1200' into v4
vorg Apr 24, 2024
16b9a69
Merge branch 'refs/heads/v4' into 354-cleanup-postprocessing
vorg Apr 24, 2024
d5a0619
refactor: switch from plain commands to renderPasses
vorg Apr 26, 2024
1122c55
build: update snowdev
vorg Apr 26, 2024
390aef6
refactor: move debugRenderer from postProcessingRenderer to renderPip…
vorg Apr 29, 2024
a4149c6
fix: make all examples run again with new render-pipeline
vorg Apr 29, 2024
71116b9
refactor: remove dead code
vorg Apr 30, 2024
45226a4
refactor: move ProgramCache to its own file
vorg Apr 30, 2024
f1494b6
refactor: use pipelineCache for postprocessing
vorg Apr 30, 2024
260c281
refactor: use pipelineCache in baseRenderer
vorg Apr 30, 2024
20997bd
refactor: rename definitions to flagDefinitions in pipelineCache
vorg Apr 30, 2024
791a8e4
refactor: add notes about exposure
vorg Apr 30, 2024
0951d19
refactor: stop injecting _geometry into flags options
vorg Apr 30, 2024
12da7e7
refactor: move ssao passes to its own file
vorg Apr 30, 2024
a197c59
refactor: split postpro passes into separate files
vorg Apr 30, 2024
0664dd0
refactor: move texture creation outside of passes
vorg Apr 30, 2024
d4087d6
refactor: assign pass name to output texture name
vorg Apr 30, 2024
a2e835e
refactor: replace postProcessingPass.disabled with enabled
vorg Apr 30, 2024
d7266ed
refactor: improve indentation
vorg Apr 30, 2024
3e65785
refactor: use resourceCache for ssao textures
vorg Apr 30, 2024
82c54dc
fix: change default ssao scale back to 1
vorg May 1, 2024
76b26d8
feat: improve graphviz scaling
vorg May 1, 2024
4fa8549
refactor: move back render-pipeline indentation
dmnsgn May 1, 2024
041ea8b
fix: use uniforms instead of this.uniforms for shadersPostReplace
dmnsgn May 1, 2024
f32dda5
fix: createPipelineCache() typo
dmnsgn May 1, 2024
41aec01
fix: remove ssao replace in post processing final effect
dmnsgn May 1, 2024
d11858d
fix: wrong import paths in pipeline-cache
dmnsgn May 1, 2024
c1b6dea
refactor: lint
dmnsgn May 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/directional-light.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export default (options) => ({
bias: 0.1,
castShadows: true,
radius: 1,
// shadowMapSize: 2048,
// shadowMapSize: 2048, //TODO: MARCIN: why is this commented out?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we have default value and it is commented here to show it exists when/if we want to test things.

...options,
});
4 changes: 2 additions & 2 deletions components/material.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @alias module:components.material
*/
export default (options) =>
options?.type === "line"
options?.type === "line" //TODO: MARCIN: Can we just have regular if () {} else {} for readability
? {
baseColor: [1, 1, 1, 1],
castShadows: false,
Expand Down Expand Up @@ -40,7 +40,7 @@ export default (options) =>
// baseColorTexture,
// emissiveColorTexture,
// normalTexture,
normalTextureScale: 1,
normalTextureScale: 1, //TODO: MARCIN: why we have default for this while not for e.g. emissiveIntensity?
// roughnessTexture,
// metallicTexture,
// metallicRoughnessTexture,
Expand Down
1 change: 1 addition & 0 deletions components/morph.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default (options) => ({
current:
options.current ||
Object.keys(options.sources).reduce((current, attribute) => {
//TODO: MARCIN: is that cloning arrays per attribute? what if they are typed?
current[attribute] = [...options.sources[attribute]];
return current;
}, {}),
Expand Down
2 changes: 1 addition & 1 deletion components/overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* @returns {object}
* @alias module:components.overlay
*/
export default (options) => ({ ...options });
export default (options) => ({ ...options }); //TODO: MARCIN: Shoudln't this have at least texure? Are defaults/docs missing?
2 changes: 1 addition & 1 deletion components/point-light.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ export default (options) => ({
bias: 0.1,
castShadows: true,
radius: 1,
// shadowMapSize: 2048,
// shadowMapSize: 2048, //TODO: MARCIN: why is this commented out?
...options,
});
2 changes: 1 addition & 1 deletion components/spot-light.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ export default (options) => ({
bias: 0.1,
castShadows: true,
radius: 1,
// shadowMapSize: 2048,
// shadowMapSize: 2048, //TODO: MARCIN: why is this commented out?
...options,
});
13 changes: 10 additions & 3 deletions examples/ao.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,20 @@ gui.addRadioList(
// renderEngine.renderers.find(
// (renderer) => renderer.type == "standard-renderer"
// ).debugRender = "data.ao";

gui.addRadioList(
"Debug Post-Processing",
renderEngine.renderers.find(
(renderer) => renderer.type == "post-processing-renderer",
renderEngine.systems.find(
(system) => system.type == "render-pipeline-system",
),
"debugRender",
["", "ssao.blurHorizontal", "ssao.blurVertical"].map((value) => ({
[
"",
"ssao.main",
"ssao.blurHorizontal",
"ssao.blurVertical",
"gtao.main",
].map((value) => ({
name: value || "No debug",
value,
})),
Expand Down
7 changes: 4 additions & 3 deletions examples/graph-viz.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,14 @@ const dot = {

containerElement.innerHTML = graphviz.layout(dotStr, "svg", "dot");
const svgElement = containerElement.querySelector("svg");

Object.assign(svgElement.style, {
position: "absolute",
right: "10px",
left: "10px",
top: "10px",
maxWidth: "80vw",
maxHeight: "400px",
opacity: 0.7,
transformOrigin: "0 0",
transform: "scale(0.25)",
});
svgElement.removeAttribute("width");
svgElement.removeAttribute("height");
Expand Down
24 changes: 10 additions & 14 deletions examples/multi-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,16 @@ renderGraph.renderPass = (opts) => {

dot.passNode(passId, passName.replace(" ", "\n"));

const colorTextureId = opts?.pass?.opts?.color?.[0].id;
const colorTextureName = opts?.pass?.opts?.color?.[0].name;
if (colorTextureId) {
dot.resourceNode(colorTextureId, colorTextureName.replace(" ", "\n"));
dot.edge(passId, colorTextureId);
} else {
dot.edge(passId, "Window");
}
opts?.pass?.opts?.color?.forEach((colorAttachment) => {
const colorTextureId = colorAttachment.id;
const colorTextureName = colorAttachment.name || colorTextureId;
if (colorTextureId) {
dot.resourceNode(colorTextureId, colorTextureName.replace(" ", "\n"));
dot.edge(passId, colorTextureId);
} else {
dot.edge(passId, "Window");
}
});

const depthTextureId = opts?.pass?.opts?.depth?.id;
const depthTextureName = opts?.pass?.opts?.depth?.name;
Expand Down Expand Up @@ -323,10 +325,6 @@ const skyboxRendererSystem = systems.renderer.skybox({
renderGraph,
});
const helperRendererSystem = systems.renderer.helper({ ctx });
const postProcessingRendererSystem = systems.renderer.postProcessing({
ctx,
resourceCache,
});

const createView = (cameraEntity, viewport) => ({
viewport,
Expand Down Expand Up @@ -417,7 +415,6 @@ ctx.frame(() => {
standardRendererSystem,
lineRendererSystem,
skyboxRendererSystem,
postProcessingRendererSystem,
],
renderView: renderView,
});
Expand All @@ -431,7 +428,6 @@ ctx.frame(() => {
basicRendererSystem,
lineRendererSystem,
helperRendererSystem,
postProcessingRendererSystem,
],
renderView: renderView,
},
Expand Down
5 changes: 3 additions & 2 deletions examples/post-processing.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,11 @@ gui.addRadioList(
value,
})),
);

gui.addRadioList(
"Debug Post-Processing",
renderEngine.renderers.find(
(renderer) => renderer.type == "post-processing-renderer",
renderEngine.systems.find(
(system) => system.type == "render-pipeline-system",
),
"debugRender",
["", "ssao.main", "dof.main", "bloom.threshold", "bloom.downsample[3]"].map(
Expand Down
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@
},
"engines": {
"node": ">=20.0.0",
"npm": ">=9.6.4"
"npm": ">=9.6.4",
"snowdev": "2.0.0-alpha.26"
},
"snowdev": {
"dependencies": [
Expand Down Expand Up @@ -89,4 +90,4 @@
],
"files": "{*.js,*(systems|components|helpers|loaders)/**/*.js}"
}
}
}
Loading