Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Is there a way to have background layers affected by the day/night lighting prefab object, but not any other lighting objects (e.g. __light)? I would like the backgrounds to change with daytime without being affected by other lighting objects to imply depth/distance.

There is no way in Eclipse too have a light only change a specific layer, object, material, etc.  Something like that would require a totally separate render pass.

My suggestion would be to use layer scripts on your background and set a simple shader that takes the day/night values such as intensity as uniforms to change the background.

Currently, if you setup the layers correctly you can have backgrounds that are totally unaffected by Eclipse (covered in basic setup tutorial).  So, all you would need to do is setup your background like that and add layers scripts.

Gotcha. I've already got the unaffected backgrounds, so I'll look into alternative layer shaders.

(+1)

Cool.  You may not really need a shader, and just setting the global draw color would work.  Basically the RGB values of the draw color would be the same as intensity of the sun light.  If it looks good then no need to do much more, or if you need more control then a shader might be needed.

Layer scripts are the easiest, and you can get the intensity value from the day/night object (make sure it exists or use "with").

(1 edit)

Thanks for this. I've managed to change the alpha of the layers depending on the day light. It works perfectly!

I have another question. Suppose I have lots of frames for character animations. I've been using both material maps and normal maps in addition to the original sprites. I haven't really needed to develop material maps for some sprites (say if there isn't a difference in metal/roughness across the entire sprite). I've also noticed that you can manually change the roughness/metalic of an object. Is there a way to simply redraw the original sprite according to these object values, instead of having to use material maps? In the draw material event, could I clear the pixels in the sprite_index (of the original sprite) to a specific material map color instead of using all these extra sprites?

If I understand what you are asking, you can do full image metal/roughness just by setting those values and not use a material map sprite.  When the material map sprite is assigned to the same sprite_index (i.e., left as default) then the shaders will draw metal/roughness using the current sprite_index and all pixels at the metal/roughness set.

Yes, that is what I intended to ask. For some reason doing this (setting to sprite_index) does not draw the metal/roughness set the same.  I may need to tinker with the specific metal/roughness settings in light of a change away from the original material sprites.

Ah, it wont be the same with sprite_index because it sets the full sprite to the single value only for metal/roughness.  The actual sprite colors would come out really weird as metal/roughness.  It is possible to try and edit shaders and use like grayscale values, but it will still be a bit odd I think.  The material packer that comes with is your best bet at easily making materials for sprites/pixel art, as most workflows for materials are much more in-depth and require full tools for doing so.

so the material map I was using was a single color. But switching to sprite index, and using the set metallic/smoothness functions doesn’t replicate the lighting effects. I think I I just need to adjust the values to recreate the effect. 

Do you have normal maps also assigned?