-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
light clipped to a scene scale ? #20
Comments
According to PointLight position is adjusted with matrix, and size is not. Divide |
I can fix it later when ill make another pass on pixi-lights. In a week, or a month, i dont know :) |
@ivanpopelyshev ok for now i do it manually in outScope pixiLight.js, the result seem ok. I don't know for performance but it a temp fix. // storage
if(CAGE.source.type === "light"){ // update session for light because not follow scale scene
CAGE.session.brightness[1] = CAGE.brightness;
CAGE.session.lightHeight[1] = CAGE.lightHeight;
CAGE.radius && (CAGE.session.radius[1] = CAGE.radius);
}
// update light zoom
if(InObjSprite && InObjSprite.source.type === "light"){
const session = InObjSprite.session;
InObjSprite.brightness = session.brightness[1]*Zoom.x;
InObjSprite.lightHeight = session.lightHeight[1]*Zoom.x;
InObjSprite.radius && (InObjSprite.radius = session.radius[1]*Zoom.x);
}; edit: function update_lightZoom() {
const list = TilesMap._objLight;
list.forEach(light => {
const session = light.session;
light.brightness = session.brightness[1]*Zoom.x;
light.lightHeight = session.lightHeight[1]*Zoom.x;
isFinite(light.radius) && (light.radius = session.radius[1]*Zoom.x);
});
if(InObjSprite && InObjSprite.source.type === "light"){
const session = InObjSprite.session;
InObjSprite.brightness = session.brightness[1]*Zoom.x;
InObjSprite.lightHeight = session.lightHeight[1]*Zoom.x;
isFinite(InObjSprite.radius) && (InObjSprite.radius = session.radius[1]*Zoom.x);
};
} |
oh, there are other parameters! Thanks, now I have more information what to fix there :) |
If we add a light to a scene.
And resize the scene with scale.
The light does not follow the zoom scale.
What would be the best approach?
Do I have to do it manually by multiplying each value by the scale of the scene.
Or there is already something native planned and that will consume less resource ?
If i need to myself, where the best place to add a update in the module?
The text was updated successfully, but these errors were encountered: