top of page

Tech - Week Fifteen

  • Elliott
  • Apr 27, 2015
  • 2 min read

As I talked about in last week’s blog post I have been looking into updating the modular building tool. Following on from last week I haven’t been able to work out or find a solution to my issue regarding having it setup in a floor based system due to the limitations in blueprint. So I’ve continued moving forward and worked on other areas in the project. There are some smaller issues that needed addressing; the ocean shader needs reworking as it its tiling is very obvious and its got a random rendering bug, wanting to add wind to the tarpaulin, minor bugs in the spline tool but otherwise my main focus looking towards the end of the project is getting the random asset tool in a good position.

To add more life to the tarpaulin meshes we wanted to get it so that they look like they are reacting to the wind. The problem being that the cloth is pulled taught in the corners so that it’s only the middle section that would move. Instead of having to create custom masks for each mesh to say where to include the wind, I’ve made a material function that can easily be added to the materials, that they are already using, which uses vertex painting to determine where to add the wind effect.

VertexWind_MaterialFunction.png

This also means we can control the strength of the wind and its effect on the mesh per instance in the level.

Although the previous ocean shader was fulfilling its purpose. As it uses sine waves to create the height map for displacement its repetition in the tiling is really obvious. To overcome this I have decided to use a texture sample instead. But instead of using several normal maps to pan over the top of each other, which will use a draw call for each map, I’m using a single texture sample with 3 different height maps, one in each channel of the texture.

NormaltoHeightMaps.png

I am then creating the normal map in the shader from the separate height maps. This has reduced to a single draw call and negated the tiling issue as I am overlaying 3 different height maps which I can control their size, speed and direction of movement independently. I could use the alpha channel as well to introduce a fourth texture but the additional use of the alpha channel changes it from 24 bit to a 32 bit texture and basically doubles the size of the file. So to keep memory usage down and the fact that I’ve got a good result with the 3 I decided not to. If need be I could just reuse one of the maps that I already have but change the scale, speed and direction of its panning and it should still give a good result.

NormalMapGeneration.png

Next week I’m going to continue working on the ocean shader, trying to smooth the displacement and work on adding the foam to the top of the waves, as well as working on the random asset location tool.

 
 
 

Comments


Featured Posts
Recent Posts
Search By Tags
Follow Us
  • Twitter Classic
  • Pinterest App Icon
bottom of page