charterhaa.blogg.se

Unity terrain splatmap texture edge blending
Unity terrain splatmap texture edge blending











unity terrain splatmap texture edge blending

If you want to use mip mapping, you'll have to generate those yourself, as the default mip mapper has no idea that your color values are indices and can't just be averaged.Īlmost all GPU compression formats use some form of interpolated colors. And offline tools like Substance are working on the full resolution textures on the per-pixel level, so mip maps and filtering are again not a thing. For sprites people often don't want mip maps or bilinear filtering anyway as they want the sharp pixelated look. For terrain you can do a lot of the work per-vertex, and then you don't care so much about mip maps or filtering. This is why it's so common for terrain, sprites, and offline stuff. You need to use point sampling and no mipmaps and use uncompressed textures for this to work properly. It's a bit messy for the moment but not that hard to understand as it's not huge.Ĭlick to expand.Yep. I also included the shadergraph splatter. Only png or tga allows to save bitmaps without loss. Be carefull not to save them as jpg as jpg is a lossy compression.

unity terrain splatmap texture edge blending

On second hand, i didn't find yet a way to change the sampling frequency from the various textures in the atlas.įirst of all, what do you guyz think about this technique ?Īny idea, criticism, knowledge is very welcome )Īnd finally do you think you could enhance this principle to make it even nicer ? This is my first deception but i'm sure this can be solved with some shader maths.

unity terrain splatmap texture edge blending

This only works ( almost ) properly when the control texture is ONLY point sampled.īilinear filtering creates intermediates between textures selection values and F***s up the result. the texture atlas ( from calculated UVs coming from mesh UVs and control map content. This works not that bad ) and is pretty cheap as the shader only have to sample 2 textures: It's just a 2048x2048 texture containing an array of 16 512x512 textures. Of course it's not decent tu input 16 separated textures in a shader. Here, among the 8 available bits for the control texture, i only use 4 of them, witch allow me to control up to 16 textures. This means that the control texture ( the splatmap ) is one channel made of one byte.Ĩ bits allow us to chose between up to 256 textures.

unity terrain splatmap texture edge blending

Instead of choosing the texture drawn from RGBA channels, i want to choose it from a byte value. What i tought that could be done is not very different of what is usually done but. Moreover, all textures are sampled for every pixel, even if the texture is not visible. 1 for each RGBA channel wich is quite limitative. Usually, splatmapping is done on RGBA channels.įor those not comfortable with this, here's a nice explanation: Splatmapping ( also known as texture-blending ) I'm playing with some nodes on shadergraph and decided to try doing funny things.













Unity terrain splatmap texture edge blending