LukasPJ Posted July 12, 2017 Share Posted July 12, 2017 Hi guys, I have a RC for the new terrain blending algorithm.You can find it here: https://1drv.ms/u/s!AtrTgygwv8wijutDuctc4erqhoSIdQAnd here's a video showing it in action:jTawTt4Lkv0 What is it?If you're not up-to-speed on the work I've been doing, my changes revolve around two major topics. First of all, I've implemented the height-based blending algorithm as described by Andrey Mishkinis, in this article: http://www.gamasutra.com/blogs/AndreyMishkinis/20130716/196339/Advanced_Terrain_Texture_Splatting.phpI have implemented that blending technique, using the height information available in the alpha channel of the normal-map. I only need to add it to macro textures as well.Furthermore, I've implemented the changes explained by @JeffR here: http://forums.torque3d.org/viewtopic.php?f=2&t=1032&start=20#p8280Well, except for the composite map, as PBR is not in yet. But the changes to how detail textures and the base texture works are implemented. You can now set the base texture, to be used by the whole terrain, on the terrain object as shown here:http://i.imgur.com/UcPnakF.pngThe diffuse texture still exists, but it is only used to generate the base-texture if you don't specify a base texture directly.I would like feedback on:Bugs, any bugs or things looking weird is always important to know aboutPerformance, how does this build perform in your various scenes/tests?What do you think of this way of using the detail texture? I.e. as a up-close diffuse texture rather than a gray-scale detail texture? Quote Link to comment Share on other sites More sharing options...
Duion Posted July 12, 2017 Share Posted July 12, 2017 The basetex is always used by the whole terrain, the base textures of individual terrain materials are just used to generate the basetex which is then always used by the whole terrain.When I'm done with my level I edit the final basetex by hand, adding final touches and giving it a better look and then save it and it will be used by the whole terrain and to prevent overwriting I created a switch in the terrain block that is called "updateBasetex" which is deactivate when I'm done and make my final basetex. Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted July 12, 2017 Author Share Posted July 12, 2017 The basetex is always used by the whole terrain, the base textures of individual terrain materials are just used to generate the basetex which is then always used by the whole terrain.When I'm done with my level I edit the final basetex by hand, adding final touches and giving it a better look and then save it and it will be used by the whole terrain and to prevent overwriting I created a switch in the terrain block that is called "updateBasetex" which is deactivate when I'm done and make my final basetex. "updateBaseTex" updates the cache, this change will allow you to provide an image to the editor instead of having to deactivate the "updateBaseTex" method. So when you are done, you set your cache to be of type "png", take the resulting image copy it to a separate file, edit it however you please, and then set it as the baseTexture. Setting it as the baseTexture, will prevent the terrain from generating new baseTexture-caches, and just use the one that has been set.Edit:Note that it still generates a cache; generating the cache even though the baseTexture is set allows the terrain to enforce a specific format (e.g. DXT or PNG). Quote Link to comment Share on other sites More sharing options...
Duion Posted July 12, 2017 Share Posted July 12, 2017 So you have two basetex files instead of one and it still regenerates the original one every time? Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted July 12, 2017 Author Share Posted July 12, 2017 Here's a small example of the detail-diffuse texture thingy.By default, the detail-diffuse texture will completely overwrite the baseTex color up-close. However, if you tweak the alpha channel of the texture, you can allow the baseTex color to bleed through where it is wanted.An example can be seen here:http://i.imgur.com/h8eR7au.pngThe cracks in the ground are used very much like the stock detail-textures currently works, simply applying detail to the underlying base color, however the straws of grass are allowed to retain their look.Here's a more extreme example, to exaggerate the effect:http://i.imgur.com/9spsQjy.pngI took a seamless texture off the web and applied an alpha-channel to it. It did take a bit of work to get the alpha-channel levels I wanted, in order to let the grass keep its color, but I'm fairly satisfied with the results.I'm not arguing that this way of handling detail-textures are necessarily "better" as such, however I, personally, find it a lot more intuitive. I don't see how we lose a lot of quality in the final product, but I'd love to be enlightened if this is the case.I've made a few bug-fixes to how the baseTex blends with the detail-diffuse. You can download a new version with these changes here: https://1drv.ms/u/s!AtrTgygwv8wijutDuctc4erqhoSIdQ Quote Link to comment Share on other sites More sharing options...
Duion Posted July 13, 2017 Share Posted July 13, 2017 The detail diffuse color will not be "completely overwritten" by the base texture.The color of the detail texture remains, it just gets blended into the base texture.Your example is probably perfectly possible in stock Torque3D, as the grass blades are just a small portion of the detail texture, so you can leave them full folor and they will keep their color ingame.The only case where the basetexture color will overwrite the detail texture color is, if the base texture color is a significantly different and stronger color, which almost never is the case. Yes the color will change, but it is far from being overwritten.Btw I made a screen using the regular texture in stock Torque3D and it looks much better, especially as the detail texture is not deleted through an alpha channel:http://duion.com/files/temp/bugs/justthenormalgrass.png Quote Link to comment Share on other sites More sharing options...
Azaezel Posted July 13, 2017 Share Posted July 13, 2017 Right so. The differences in general design for an end user according to the specs discussed thusfar would be shifting the 'this does not effect the base color result' from a 128 greyscale middle to a 0 alpha.This has two effects:1) Removes the 'capacity' to darken a given basetex via subtracting a negative-color.2) Shifts The math used from half the available color range for darkening, half for brightening to the full range for blending.Either one is capable of producing either result in theory (within reason), given enough familiarity. Quote Link to comment Share on other sites More sharing options...
LukasPJ Posted July 13, 2017 Author Share Posted July 13, 2017 Last update for a while:Repo with changes:https://github.com/lukaspj/Torque3D/tree/Terrain-Texture-Blending-2Edit: The code is unpolished so don't judge me.Latest build (now supports macro textures):https://1drv.ms/u/s!AtrTgygwv8wijutDuctc4erqhoSIdQ Quote Link to comment Share on other sites More sharing options...
Duion Posted July 13, 2017 Share Posted July 13, 2017 You should learn how to do scientific comparison tests.The scene the textures etc everything has to be identical as well as position of camera etc then you make a screenshot in stock and one with your changes. So that the only difference between screenshots is your changes, then you can objectively see which is better. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.