News:

Be sure your post is relevant to the current discussion.  Create a new topic within the appropriate board if you are unsure.

Main Menu

Brick and checker scaling Lux and Red.

Started by Andy H, April 26, 2022, 07:55:08 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

Andy H

Day 3 of the 15 day trial. I thought I'd look at texture scaling.   Fortunately (for me anyway).  Lux scaling is similar to RedSDK.  though it could be more confusing to Lightworks users.  So I thought I'd jot down my thoughts.

This assumes you already know most things about texture wrapping.  and is just specific to multi textures like Brick and checkers.  The pixel count of the image only matter For quality.  The render will be the same size, whether using 512 x 512 pixel image, or 1024 x 1024 pixels,  Only the quality / detail of the render may be better with larger pixel count.

At a 1 to 1 scale, The calculation is simply 1 / object size.  So if we have a 300 x 300 unit object, the scaling would be 1 / 300  = 0.00333 in both U and V boxes.  Simple eh..   But life isn't always that simple. Scaling a small texture image on a large object, may not look good. So we have to compensate by tiling the texture or using a much larger texture. Like 1280 px x 1280 px, instead of 512 x 512.    For tiling, if, on our 300 unit square, we want 2 tiles high and wide.  It would simply be 1 / (300 / 2) = 1 / 150 = 0.006666

However.... Some textures have multiple elements.  For the first example I will use Brick-Rough-Realistic-Brick.   I chose this because the Lux thumbnail is not accurate. The Luxcore thumbnail shows roughly 3 bricks wide by 6 bricks tall,  This is incorrect.  The correct texture used is shown in C:\Program Files\IMSIDesign\TCW2022\Materials\Textures\RedSdk.  And is 8 bricks wide by 14 bricks high. 

So. How is this useful.   It is useful because we can scale our bricks to be more realistic size.  Taking a standard metric UK brick, and having our drawing space units as mm.  We have 215 units wide, by 65 units tall.  Then allow for 10mm mortar, we get 225 x 75. (We are not bothered about the brick depth).

An important point.  It will never be fully accurate, because the rough brick texture isn't the aspect ratio of a standard brick, and we don't know the percentage of mortar.  But it is close enough for our rendering.   Also different textures may contain a different amount of brick wide and high.  So the 8 bricks used here is just for Realistic rough brick.  + don't forget to alter the bump map scaling as well as image map. 

We know our texture has 8 bricks wide, therefore 225 uints  x 8 brick = 1800.  And 75 units x 14 bricks high = 1050.    Using this information, we can say Scale U  = 1 / 1800 = 0.000555.  And Scale V = 1 / 1050 = 0.000952.
 
If the space units were Metres, it would be 0.225m x 8 = 1.8,  And 1 / 1.8 = 0.555 in the scale U box.

Using an template based on feet. and an American brick of 8 inch x 2 1/4 inch. it would be 0.6666 ft and 0.1875 ft. + Mortar thickness of 0.03125 ft,  gives 0.69785  and 0.21875.  Therefore 0.69785 x 8 = 5.5825,  Scale U =  1 / 5.5825 = 0.17912   and 0.21875 x 14 = 3.0625. Scale V =  1 / 3.0625 = 0.32653

The second example we use a checker pattern for lino floor (so no need for mortar). 

The checker pattern is 4 x 4, which makes it nice and simple. Our space units are set to Centimetres (cm).  we want each individual checker square to be 15cm x 15cm.  Therefore it would be.  15 x 4 = 60.   and 1 / 60 =  0.01666.  Therefore we type in scale U and scale V boxes 0.01666, to get roughly the correct sized checker pattern.
American English with a drawing in feet, would be.  6 inch squares = 0.5ft..   0.5 x 4 = 2..   1 / 2 = 0.5 in the scale U and scale V boxes.

Hopefully I calculated correctly  :)


Henry Hubich

It didn't take you long to nail that, Andy!

I finally came to understand Scaling in Lux by realizing that the "Scale" value is really the number of copies of the image per drawing unit. (Thus a Scale of 0.1 means one-tenth of the image per inch--or meter or whatever--which means the full image will span ten inches--or meter or whatever.) IMO, "Scale" is a misleading term and that a better one would be "Spatial frequency."

Henry H