Add dynamic shader generation

This commit is contained in:
schmelczerandras 2020-07-26 13:35:44 +02:00
parent edd7d4836e
commit 4369cf1770
22 changed files with 300 additions and 124 deletions

View file

@ -23,7 +23,7 @@ export class CircleLight extends GameObject {
}
private draw(c: DrawCommand) {
if (c.drawer.isOnScreen(this.boundingCircle)) {
if (c.drawer.isPositionOnScreen(this.center)) {
c.drawer.appendToUniformList('lights', {
center: this.center,
radius: this.radius,

View file

@ -17,7 +17,7 @@ export const createDungeon = (objects: ObjectContainer) => {
new Tunnel(previousEnd, currentEnd, previousRadius, currentToRadius)
);
if (deltaHeight > 0 && Math.random() > 0.5) {
if (deltaHeight > 0 && Math.random() > 0.8) {
objects.addObject(
new CircleLight(
currentEnd,