HeapsIO / heaps

Heaps : Haxe Game Framework

Home Page:http://heaps.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Point lights broken

Misiur opened this issue · comments

https://heaps.io/samples/lights.html - the lights are broken.

I thought maybe ab2ce16 fixed it, but it's not the case.

Locally checked with today's git version, broken as well. No difference between browsers.

Hey @Misiur, If you are using PBR lights, a quick workaorund for now would be to set for every ligth you create a value for the Light.occlusionFactor (0 is the default), as this value is undefined by the time it gets to the browser and the shader fails catastorfically (and thus black lights).

Something like this will do the trick:

var l = new DirLight(parent);
l.occlusionFactor = 0.0;

The PBr should set this (an other values) to a defualt value so it doesn't happen, the specific values are:

  • SpotLight.fallOff
  • PointLight.size
  • Light.occlusionFactor

You might want to set those values as well for ther light types as well.