Minor changes and documentation

This commit is contained in:
schmelczerandras 2020-10-12 16:11:55 +02:00
parent cdcac35b68
commit 25c112f0e5
22 changed files with 376 additions and 244 deletions

View file

@ -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);

View file

@ -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