Merge branch 'WIP' into main
This commit is contained in:
commit
1e4dd8555d
30 changed files with 571 additions and 275 deletions
|
|
@ -239,7 +239,7 @@ export class RendererImplementation implements Renderer {
|
|||
palette: 1,
|
||||
|
||||
distanceNdcPixelSize: 2 / Math.max(...this.distanceFieldFrameBuffer.getSize()),
|
||||
shadingNdcPixelSize: 2 / Math.max(...this.distanceFieldFrameBuffer.getSize()),
|
||||
shadingNdcPixelSize: 2 / Math.max(...this.lightingFrameBuffer.getSize()),
|
||||
};
|
||||
|
||||
this.distancePass.render(this.uniformsProvider.getUniforms(common), ...this.textures);
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ float getDistance(in vec2 target) {
|
|||
|
||||
float shadowTransparency(float startingDistance, float lightCenterDistance, vec2 direction) {
|
||||
float rayLength = startingDistance;
|
||||
for (int j = 0; j < SHADOW_TRACE_COUNT; j++) {
|
||||
for (int i = 0; i < SHADOW_TRACE_COUNT; i++) {
|
||||
rayLength += max(0.0, getDistance(uvCoordinates + direction * rayLength));
|
||||
}
|
||||
return min(1.0, pow(rayLength / lightCenterDistance, 0.3));
|
||||
|
|
@ -103,7 +103,7 @@ void main() {
|
|||
lightCenterDistance,
|
||||
direction
|
||||
);
|
||||
|
||||
|
||||
lightingInside += lightColorAtPosition;
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue