Jump to content

New Terrain Blending test


LukasPJ

Recommended Posts

Hi guys, I have a RC for the new terrain blending algorithm.


You can find it here:

https://1drv.ms/u/s!AtrTgygwv8wijutDuctc4erqhoSIdQ


And 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.php

I 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#p8280

Well, 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.png


The 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 about
  • Performance, 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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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).

Link to comment
Share on other sites

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.png


The 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.png


I 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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...