3dreamengine / 3DreamEngine

3DreamEngine is an *awesome* 3d engine for LÖVE.
MIT License
373 stars 16 forks source link

Excluding objects from light sources #70

Open CrossroadInTheVoid opened 7 months ago

CrossroadInTheVoid commented 7 months ago

Is there any way to exclude objects from light source? I've noiced that at least in old versions of 3DreamEngine SpriteBatches are affected by light sources and when they have their own emission, they become too bright.

Luke100000 commented 7 months ago

Yes, no light equals black albedo color, so you can set the color to black.

For example a candle flame:

local spriteBatch = dream:newSpriteBatch(texture, texture)
spriteBatch.material.color = {0, 0, 0, 1.0}

The same emission texture is used for albedo, but we effectively only use the alpha channel.