Creating Materials with a Detail blending layer Korman 0.09

If you feel like you're up to the challenge of building your own Ages in Blender or 3ds Max, this is the place for you!

Creating Materials with a Detail blending layer Korman 0.09

Postby boblishman » Wed Jan 29, 2020 12:18 pm

I'm posting this to save anyone new to Korman 0.9 to save themselves a lot of time playing around trying to get the Plasma "detail blending" to work correctly.

Currently there is nothing in the wiki (that I could find) to explain how to get this function working with Korman.
Materials with a "detail" texture layer were something that I used with Pyprp as I hate materials that are blurry or pixilated when you get close to them. This is particularly noticeable with large areas (walls, floors, terrains) that you don't want to be horrible from a distance (to repetitive) - or close up (blurry/pixellated). Good UV mapping helps but, alone, cannot stop this from happening with large surfaces. Using a "detail" texture layer solves this by slowly replacing/merging/blending one texture into another as the camera gets closer to the object.

Having played around with it for a couple of DAYS I finally figured it out this works with the Korman plugin and I now have it working perfectly in tPots exports from Blender. (I have not set up a MOULa export option so I have no way of knowing if this is different for MOULa based games, but I suspect not).

It's actually very simple ... once you know how.



The main difference between using this blending type in Pyprp and Korman is that your texture does NOT need an alpha channel and, in fact, I found images with NO alpha gave me the best results. You can also use the same .png image file for both the "distance" texture and the "detail" texture.

Here's what I did:

(I am assuming you are familiar with creating "normal" materials using texture layer(s) with image files)

Create the new object, make sure its selected in the 3D window and then:

a) In the Properties Panel, click on the Material button and add new material and rename it. (I used "detail texture test object") but it can be anything

b) Click the Texture panel icon and add a single texture layer and rename it (I used "far", but you can use any name).

c) Use a NON-transparent .png image file. and UV map it so it looks good from a distance

d) In the Texture Panel add a second new texture layer and rename it (I used "closeup" but it can be anything).In the Image panel, use the dropdown button and select the same png file (mine is called BareGround.png).

so you should have something like this ...
Screenshot 2020-01-29 at 19.10.10.jpg
Screenshot 2020-01-29 at 19.10.10.jpg (18.99 KiB) Viewed 2954 times


Now check all the properties panels in both texture layers ... and make sure any boxes with reference to "Alpha" are UNchecked. Some are checked by default. Uncheck them.

Now, this is where the magic happens....

For the "closeup" texture layer, in the "Mapping" panel and change the size for x,y and z from 1 to ... 8.
Screenshot 2020-01-29 at 19.45.04.jpg
Screenshot 2020-01-29 at 19.45.04.jpg (23.2 KiB) Viewed 2954 times

Look in your 3d window and you'll see the texture has become much smaller. Increase (or decrease) this value until the uv mapping in your 3D window is how you want the object to look in Uru when you are close up.

Finally, still in your "closeup" texture layer, you need to scroll down to the Plasma Layer Options panel, tick the "Detail Blending" checkbox and change the values to these...
Screenshot 2020-01-29 at 19.50.42.jpg
Screenshot 2020-01-29 at 19.50.42.jpg (24.03 KiB) Viewed 2954 times

(You can play around with them but these seem pretty ok to me for most purposes).

Not: The Plasma Detail Blending only affects the one layer (above it) in the texture layers panel. This means you can use it with stencils as if the two texture layers were just a single layer.

You can see here how it looks below, though these are not great screenshots.
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: Creating Materials with a "Detail" blending layer Korman

Postby boblishman » Wed Jan 29, 2020 12:20 pm

detail.jpg
detail.jpg (486.23 KiB) Viewed 2953 times
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: Creating Materials with a "Detail" blending layer Korman

Postby Deledrius » Wed Jan 29, 2020 5:33 pm

Thanks for writing this up! Unfortunately, features added in the last version of Korman or so are a bit lacking in documentation due to everyone being busy IRL since that release. Sorry about that!

If you think you can make something properly-formatted for the wiki, please feel free to start the page with a formalized version of your instructions. :) It would be very appreciated!
User avatar
Deledrius
Gehn Shard Admin
 
Posts: 1377
Joined: Mon Oct 01, 2007 1:21 pm

Re: Creating Materials with a Detail blending layer Korman 0

Postby boblishman » Thu Jan 30, 2020 8:53 am

Yes, I could do that. I'll set some time for it this weekend.

Meanwhile, here's a video of the effect as it appears in Uru .... https://youtu.be/MxsWGF_wKKk
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: Creating Materials with a Detail blending layer Korman 0

Postby boblishman » Mon Feb 03, 2020 7:33 am

Ok. I'm going to do the wiki tutorial this week. Could one of the Korman guys explain exactly what each of these sliders do so I can add it to the page....
I know that these setting "work" but not what they actually represent.

Image
when it comes to Age creation ... "DOH" seems to be my middle name...
User avatar
boblishman
 
Posts: 882
Joined: Fri Oct 05, 2007 4:47 pm
Location: Spain

Re: Creating Materials with a Detail blending layer Korman 0

Postby Tsar Hoikas » Mon Feb 03, 2020 10:30 pm

Disclaimer: this feature was ported rather shamelessly from Cyan's Max plugin.

As you seem to have surmised, a detail map is actually a single texture. Korman creates a copy of the image you assign to the texture and adjusts the alpha channel (aka transparency) of that texture based on your inputs, which is probably why the best results are with textures without alpha. In 3d graphics, textures are generally stored with "mip levels", which are copies of the image that scale down in resolution. Textures are 99% of the time powers of two, so your mip levels will look something like so:
  • 0: 512x512
  • 1: 256x256
  • 2: 128x128
  • 3: 64x64
  • 4: 32x32
  • 5: 16x16
  • 6: 8x8
  • 7: 4x4
  • 8: 2x2
  • 9: 1x1

This texture has 10 mip levels. (Unfortunately, due to a bug in the way Plasma has stored texture data for at least the last 17 years, the smallest two mip levels are potentially junked, and Korman does not even attempt to generate them. This has resulted in a slight bug in the way Korman generates detail maps in 0.09 and lower--see if you can figure it out!) When the object the texture is applied to is farther away, taking up less space on the screen, the smaller mip levels are used in game. A detail map as currently exposed in Korman clamps every alpha value to a calculated value based off your inputs and the current mip level. Smaller mip levels become more transparent while larger mip levels become more opaque. The "falloff" values indicate which mip levels the fading should start and stop at. You can roughly say this is: "how far away is the texture from the camera?" The opacity values are used as the range through which the alpha values will be interpolated.

So, using your image an an example and assuming an image with no alpha... On mip 0 (the largest), the alpha channel value will be 95% (or 0.95 or 242, depending on how you choose to visualize that information) while on mip 9 (the smallest), the alpha channel value will be 0%. Note that if you lower the value of Falloff Stop, the opacity interpolation will occur over fewer mip levels. For example, if you had set Falloff Stop to 40%, the alpha channel would be at 0% by mip 3.

Some notes: Every time you have a detail map with different settings, that is a new texture exported. Korman is smart enough to join uses of the same texture and same properties across multiple materials, however. The plugin should be tolerant of the values being "backwards," meaning reversing both sets of start/end values, but that is relatively untested.
Image
Tsar Hoikas
Councilor of Technical Direction
 
Posts: 2180
Joined: Fri Nov 16, 2007 9:45 pm
Location: South Georgia


Return to Building

Who is online

Users browsing this forum: No registered users and 0 guests

cron