June 12, 2015

The Perfect Tile System - Released on UE4 Marketplace! Development Priorities.

UPDATE: 8/7/2015 - I fixed a bug that caused some textures to not tile properly with parallax mapping. The fix also allows materials using Parallax Occlusion to retain all local tiling adjustments. I also have some more toggles for the performance-minded folks: you can toggle the special metallic shading on and off. On, and metals appear brighter around the edges with an added sheen. You can also toggle between simple and complex gamma correction. Simple uses a multiply node for a power of 2.0 and saves 3 instructions. Complex uses a power node for a power of 2.2, bringing colors closer to sRGB standards, but uses 3 more instructions. The flexibility just got a whole lot better!

Stay tuned for further updates!

UPDATE: 7/6/2015 - I have just finished an integration of roughness maps and a variety of randomization settings. Tiling can now take place in world space as well, for perfectly seamless floors, walls, and ceilings across multiple meshes without the need for perfect UVs. And custom UVs are now utilized for global scaling within the system (unfortunately, this optimization was performed under the hood all along like I had hoped). Other improvements also took place, mainly to fix minor bugs and streamline the pipeline. The improvement are not over yet, though. I still need a bit more time to develop a good solid update, which includes rewriting the user guide.

I have squashed out the ability to swap linear and sRGB assets from the system. Because sRGB does not follow a standard exponential curve, it will be impossible for me to convert it in any reliable way to take advantage of the dual features. I am thinking about including sRGB tile maps as an option when dual color/roughness features are not required, which would save instructions and look slightly more accurate, but both sRGB and dual surfacing are not seamlessly compatible with each other.

---

So, The Perfect Tile System is finally up on the Marketplace!

https://www.unrealengine.com/content/8b8ae16ae659425384a6caaafc36212a

This is great news, but it's not all over yet! Listed below are some plans I have for the shader system, including both optimizations and newer features. Please comment on this blog for features you'd like to see. I will update this list:

High Priority
  1. Inclusion of Roughness maps for surface detail (requires full-scale integration with the tile distortion and parallax features).
  2. Switch between linear and sRGB assets (the dual color algorithm makes this very difficult).
    Unfortunately, swapping between linear and sRGB assets is impossible in the engine. Instead, I use a power of 2.2 on linear assets, or 2 for the optimized method.
  3. Tiling optimization using custom UVs for global scale.
  4. Toggle world-space coordinates (must also work with parallax and texture tile distortion).
Medium Priority
  1. Colored Tile Maps (easy to implement for linear color, difficult for sRGB).
  2. Optimum Map that combines TM, metal map, glass map, and scattering maps all in one texture. Parameter masked with RGBA values to eliminate the need for extra draw calls with heavy TM materials.
  3. Optimum Map 2 for displacement, roughness, and custom AO.
  4. Special tiling for bricks and panel flooring to convert pixel TMs into more complex TMs, uses instructions but saves texture space and time in bitmap editor (parallax makes this difficult).
    While special tiling features have now been added, including the tile randomizer and world coordinates, the brick tiling method produces unpleasant results for too much instruction cost. While there is some work required to make a manual brick TM, the work is well worth the hassle when it comes to optimization. The included TMs work for 65,536 individual bricks. I may make a larger texture in a newer update.
Low Priority
  1. Detail texturing (requires another pipeline to be added. Not too difficult, just time consuming).
  2. Tile randomizer (must also be compatible with texture tile distortion).
  3. Simple gamma corrector to save instructions on colors (but will result in less accurate colors).

May 4, 2015

The Perfect Tile System - Up on Trello!

https://trello.com/c/SNP7QkhW/360-the-perfect-tile-system

It was a long and bumpy road, but the system is finally up on Trello for votes! 2 days in and it already received 10 votes, ranking 3rd. for all systems in the category. Please go there and vote now if you want to see this on the Marketplace!

There are of course a ton of features I would still like to update the system with, but it takes time to experiment and implement across the board:

  • Switch between linear and sRGB assets (the dual color algorithm makes this very difficult)
  • Colored Tile Maps (easy to implement for linear color, difficult for sRGB)
  • Special tiling for bricks and panel flooring to convert pixel TMs into more complex TMs, uses instructions but saves texture space and time in bitmap editor (parallax makes this difficult)
  • Inclusion of Roughness maps for surface detail (requires full-scale integration with the tile distortion and parallax features)
  • Tile randomizer (must also be compatible with texture tile distortion)
  • Detail texturing (requires another pipeline to be added. Not too difficult, just time consuming)
And there are some further optimizations I'd like to include as well:
  • Optimum Map that combines TM, metal map, glass map, and scattering maps in one texture, parameter masked with RGBA values to eliminate the need for extra draw calls with heavy TM materials.
  • Simple gamma corrector to save instructions on colors (but will result in less accurate colors)
  • Ability to feed textures without needing to gamma correct.

April 7, 2015

The Perfect Tile System - Trailer

Well, it's finally finished! The Perfect Tile System is ready for release! Make sure to watch the trailer at 720p or higher to get the best quality playback and framerate (yes, it is 1080p 60fps native).

February 24, 2015

Types of Displacement




Special shout-out to caner_ozdemir for his UE4 Iterative Parallax material setup... and making me aware that such a method even exists! For just 12 more instructions, you can iterate the parallax displacement 5 times and get a much cleaner result. I can easily see this method becoming the go-to method for displacement with modern mid-grade and even low-end GPUs.

February 10, 2015

Big Update!: Parallax Occlusion is now fully featured in the Perfect Tile System!

In UE4's forums, user Ehamloptiran shared his custom Parallax Occlusion HLSL code with all the forum goers. Since this project's beginning, I was excited to get parallax occlusion integrated, but there was no way to do it and keep the shader clean. Thanks to Ehamloptrian, I was able to use the code in my project in a very novel way. In order to obtain separate parallax tiling for the Tile Map, I simply had to divide the UV result of the parallax occlusion code by the TM tiling values. This way, I only need to run the occlusion code once. I will be implementing this novel solution through the basic parallax as well and see if it saves the instruction count some more.

There are some things to work on, though: silhouette clipping, and the possibility of bringing back freeform tiling. But in the meantime, you may go ahead and enjoy these screenshots.


February 9, 2015

Polys, Normals, and Tessellation

A simple visual showcasing the differences between rendering low poly geometry, normal mapping, normal map+tessellation, and a high poly model. Normals take care of lighting and shadows, but not silhouette. Tessellation smooths out the silhouette, but if you stick to low-poly normals and don't use a normal map, then the lighting might not smooth out the way you expect. But tessellation together with a normal map replicates a high-poly result to the tee. While it is a tiny bit more difficult to render as it uses a more complex pixel and vertex shader, it will still handle LODs much better than a high-res output and save thousands of polygons.


February 8, 2015

Perfect Tile System - Rewriting and More Rewriting...

For the past few months, I've been working on a shader project in UE4 to handle detail tiling with a grout system. I'm also putting a lot of work into making a pdf document, solid presets that demonstrate a variety of different features, and streamlining the system as best as I can.

Check out updates for this project here!: https://forums.unrealengine.com/showthread.php?50022-Perfect-Tile-System-Do-you-guys-want-this-for-the-Marketplace

One of my biggest setbacks was my incessant need to keep adding features to this thing. Originally it was just a basic multiplication and grout system to handle tiles and some tiling features, but it ballooned into a glass shader, a frosted glass shader that mimics interscattering, a dual-tile algorithm with a controllable midpoint value, texture maps (and dual texture maps), parallax displacement, falloff blending, etc, and it's just gotten crazy. So much so that certain new features required a complete rewrite of the shader's blending setup... multiple times. Upon release, it might as well be called the Perfect Tile System 3.0: nearly every single piece of code would have been written 3 times. And it's still not completely "perfect."

Initially, I used spider web branches to control how toggling different options affect the system. This makes sense if there's only a couple features to worry about. But I revamped all the toggling to feed into each other down a line. The end result is much cleaner code that allows me to add features and make changes to the system rather easily, but getting to that type of solution can be difficult to figure out: the order must be tested under as many circumstances as possible to avoid bugs or rendering errors.

For anyone following, I appreciate your patience with me and this project. I will strive to create the best product I possibly can. Here is my current to-do list:

  1. Finish cleaning up the shader
    1. Textures and Glass features combined are currently untested: may be unstable (medium priority)
    2. "Lerp" functions should be replaced with "If" functions/parameters and be tested for optimum performance (medium priority)
    3. Debug scattering map checkerboard pattern blows out colors and does not cancel out wrong parameters (low priority)
    4. Dual tile implementation is very broad, but not universal, and more can be done with it (low priority)
    5. Clear Coat implementation is very basic at the moment (low priority)
    6. Roughness implementation is good, but more could be done with it (low priority)
    7. Specularity currently has no implementation. This saves on instructions, but more can be done (low priority)
    8. AO implementation is OK for its purpose, but it's pretty basic at the moment (low priority)
  2. Asset Management
    1. Remake all instances for compatibility with final shader
    2. Delete unused assets
    3. Size management
    4. Fix redirectors
    5. Package project for development
  3. Ensure guide is updated to reflect recent changes
    1. Dual tile algorithm midpoint
    2. Parallax options
    3. Shader organization
  4. Package project for development
    1. Quick Test open
  5. Demonstration/Advertisement Video
    1. Music
    2. Narration
    3. Matinee Setup
      1. Live Demo
      2. Matinee Recording
    4. Final Editing
  6. Screenshots
  7. Submit!