Skip to content

Commit

Permalink
WebGLRenderer refactorings + SAO
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Sep 25, 2024
1 parent 90689f5 commit 31afc46
Show file tree
Hide file tree
Showing 44 changed files with 1,569 additions and 635 deletions.
3 changes: 3 additions & 0 deletions packages/webglrenderer/src/Layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface Layer {
layerIndex: number;
sortId: string;
meshCounts: MeshCounts[];
saoSupported: boolean;

//---------------------------------------------------------
// Builder methods
Expand Down Expand Up @@ -68,6 +69,8 @@ export interface Layer {

drawColorOpaque() : void;

drawColorSAOOpaque(): void;

drawColorTranslucent(): void;

drawDepth(): void;
Expand Down
6 changes: 3 additions & 3 deletions packages/webglrenderer/src/RENDER_PASSES.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ export const RENDER_PASSES = {

NOT_RENDERED: 0,

// Normal rendering - mutually exclusive modes
// Draw color, or draw depth or normals for post-effects

COLOR_OPAQUE: 1,
COLOR_TRANSPARENT: 2,
DRAW_OPAQUE: 1,
DRAW_TRANSPARENT: 2,

// Accents silhouette rendering - mutually exclusive modes

Expand Down
10 changes: 2 additions & 8 deletions packages/webglrenderer/src/RenderContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ export class RenderContext {
*/
public pbrEnabled: boolean;

/**
* Whether SAO is currently enabled during the current frame.
*/
public withSAO: boolean;

/**
* Whether backfaces are currently enabled during the current frame.
*/
Expand Down Expand Up @@ -125,7 +120,7 @@ export class RenderContext {
/**
* The occlusion rendering texture.
*/
public occlusionTexture: WebGLAbstractTexture | null;
public saoOcclusionTexture: WebGLAbstractTexture | null;

public pickClipPos: FloatArrayParam;

Expand All @@ -145,7 +140,6 @@ export class RenderContext {
reset() {
this.lastProgramId = -1;
this.pbrEnabled = false;
this.withSAO = false;
this.backfaces = false;
this.frontface = true;
this.textureUnit = 0;
Expand All @@ -157,7 +151,7 @@ export class RenderContext {
this.pickZFar = 5000;
this.pickInvisible = false;
this.lineWidth = 1;
this.occlusionTexture = null;
this.saoOcclusionTexture = null;
}

/**
Expand Down
Loading

0 comments on commit 31afc46

Please sign in to comment.