|
0.162 HLSL
#341020 - 06/03/15 04:53 PM
|
|
|
Is there a guide or more detailed information about how to configure HLSL with the recent changes in 0162?
Specifiaclly, around how to properly configure the shadow_mask_x/y_count and shadow_mask_u/vsize?
For example, I'd like to use the slot-mask.png (48x48 pixels) and I'm not sure what the shadow mask count should be.
Thanks!
|
|
|
|
Re: 0.162 HLSL
[Re: lamprey]
#341036 - 06/03/15 11:10 PM
|
|
|
Short answer:
Code:
shadow_mask_texture slot-mask.png shadow_mask_x_count 6 shadow_mask_y_count 6 shadow_mask_usize 0.1875 shadow_mask_vsize 0.1875
Long answer:
Direct3D uses textures with a size of power-of-two, which means every texture will be extended to the next power-of-two; e.g. 48x48 will be extended to 64x64. To get a complete tile of the slot-mask you need 12x12 pixel, starting at the left upper corner. Now a simple division...
12 / 64 = 0.1875
... and you have the size of the tile in uv-coordinates.
What's about the xy-count? In previous versions of the shader you could specify how many times the uv-sized texture should be tiled. Now you can specify how large one tile should be displayed on the screen.
In this example the 12x12 pixel large tile will be displayed as 6x6 pixel on your screen. In other words you can scale the mask.
Unfortunately, a large prescale is required to get a clear result. The slot-mask and the adapture-grill should be used with a prescale of at least 6, the shadow mask can be used with a prescale of 4. A smaller prescale will result in a blurry mask.
For the sake of completeness:
Code:
shadow_mask_texture adapture-grill.png shadow_mask_x_count 3 shadow_mask_y_count 3 shadow_mask_usize 0.09375 shadow_mask_vsize 0.09375
Code:
shadow_mask_texture shadow-mask.png shadow_mask_x_count 6 or 3 shadow_mask_y_count 8 shadow_mask_usize 0.1875 shadow_mask_vsize 0.25
|
|
|
|
Re: 0.162 HLSL
[Re: Jezze]
#341037 - 06/03/15 11:15 PM
|
|
|
Perfect! Thanks for the details!
|
|
|