Lighting and effects with a texture atlas

Started by
3 comments, last by SpikeViper 8 years ago

Since the last time I've been here, my game's going along nicely. I have planets made of blocks generated on the fly. I use a texture atlas to supply the textures for all of the different block types I have. And here comes the problem. I want some object to look metallic and shiny, while others will be quite dull. I also want some blocks to glow (Uranium, lava, etc.). Using unity I tried using an emission map, but it bled the light into different blocks in the atlas and, even worse, since the object was dynamic I wasn't able to have the light effect other blocks. What are some ways to go around giving all of these blocks different properties? I was thinking about passing values to the mesh sort of how Vertex Colors work, but I understand in unity the amount of data you can send to a mesh is limited. Thanks in advance!

I'm making an open source voxel space game called V0xel_Sp4ce! Help me out with the repository here: https://github.com/SpikeViper/V0xel_Sp4ce

Advertisement
I am not sure what the problem is. How is unity bleeding light into the atlas?

It should not be emitting anything in areas that don't have that effect. Could you post a picture?

bleeding.png

As you can see, the red (that's supposed to be a single block) glowing is moving onto other blocks on the atlas. The blocks are even separated by 32 pixels to prevent texture bleeding. It appears unity does not actually emite light out of these - it just edits the texture to look like it is. On the bottom right you can see that the red block lights up about 1/6th of the entire atlas. But lighting is only one problem. I also want each block to have their own smoothness and metallicness values. I want to put these values in as you would put in vertex colors - per vertex so I can control each block, or I could possible use a specular map. The emitting blocks also don't light the blocks around them.

I'm making an open source voxel space game called V0xel_Sp4ce! Help me out with the repository here: https://github.com/SpikeViper/V0xel_Sp4ce

This is preferably how I would like them to glow, and notice how it effects its surroundings:

target.jpg

I'm making an open source voxel space game called V0xel_Sp4ce! Help me out with the repository here: https://github.com/SpikeViper/V0xel_Sp4ce

Fixed the emission bleeding by making the rest of the texture black (had it set to transparent). Made it glow using a Bloom script.

Thanks!

I'm making an open source voxel space game called V0xel_Sp4ce! Help me out with the repository here: https://github.com/SpikeViper/V0xel_Sp4ce

This topic is closed to new replies.

Advertisement