question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Share] My extension of PIXI for Lighting.

See original GitHub issue

My extension is inspired by https://github.com/pixijs/pixi-lights. But it’s not simple port of old pixi-lights, it’s re-designed.

The differences :

  • Better performance (just a bit little)
  • A new renderer named LightSpriteRenderer, don’t change WebGLRenderer & SpriteRenderer
  • Light is not the subclass of DisplayObject, it’s just a normal Class.
  • attribute lights on sprite, don’t need to add a light object to the stage/container. Now, you could set different lights on different sprites in the same stage.
  • AmbientLight is not necessary, you could use ambientColor and ambientLight on PointLight and DirectionalLight. But just use on the first light of lights please.
  • support non-light-sprites in correct rendering order. (the old pixi-lights always render non-light sprite on the top).
  • use pluginName for using LightSpriteRenderer ( see #3330 )
  • add an important feature of pixi-gl-core ( see https://github.com/pixijs/pixi-gl-core/pull/18 )
  • DO NOT support Container . Please use LightSpriteRenderer on standalone Sprite with normalTexture.
  • … others…

My english is very poor , so , the example is better than my words : http://fattyboy.cn/pixi-lights-v4/

the key files of this feature in my fork version at : ~~https://github.com/finscn/pixi.js/tree/master/src/extension/light~~ [update: new url] : https://github.com/finscn/pixi.js/tree/master/src/extensions/renderers/light

Why don’t use Deferred Lightning ?

I found that Deferred Lightning in 2D game with WebGL won’t help for performance in most cases.

BTW, I’ve stopped to develop Light Filter. If want to implement it ,I have to create a new subclass of Sprite for render normalTexture. That’s so complex.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
finscncommented, Jan 31, 2017

pixi-layers is an amazing feature , I couldn’t wait for it.

2reactions
finscncommented, Jan 31, 2017

Hi guys , now support deferred-lighting .
When pixi supports gl.bindAttribLocation , I will open a PR for this feature.

@GoodBoyDigital , when will pixi support gl.bindAttribLocation ?

P.S. : I’ve open a PR #3682 for gl.bindAttribLocation. Review please, thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Share] My extension of PIXI for Lighting. · Issue #3360 - GitHub
A new renderer named LightSpriteRenderer , don't change WebGLRenderer & SpriteRenderer; Light is not the subclass of DisplayObject, it's just a ...
Read more >
[Share] My extension of PIXI for Lighting. - Bountysource
My extension is inspired by https://github.com/pixijs/pixi-lights. But it's not simple port of old pixi-lights, it's re-designed.
Read more >
Virtual Reality Kit W/ Pixi Evo And Aluminium Extension
Compact, light and always-ready kit for small 360° cameras · Mini tripod with two leg angles · Legs can be extended in five...
Read more >
Pixi Lighting A19E-9WX 8.5-Watt LED Light Bulb, Warm Color
The Pixi A19E-9WX is a standard bulb replacement (40 Watt equivalent) with a warm color temperature. Pixi LED bulbs last years longer and...
Read more >
Layered Lighting System Using Masks Issue - Pixi.js
I'm using pixi-layers & pixi v4. I have Sprites that use a texture (generally png) as a light. This gets added to the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found