Technical art
Interior Mapping
A shader technique to create the illusion of interior spaces without additional geometry
Description

Project: Personal
Instruments used: UE5, Blender, Photoshop
Interior Mapping Shader
My approach, aimed at saving resources, uses a single cross-layout texture instead of a cubemap to create the room walls and four variations of furniture.
Rooms
There are 3 types of room sizes (aspect ratios):
- 1x1x1, 2x2x2, 3x3x3
- 2x2x1, 4x4x2
- 3x3x1
The textures are stored in three texture arrays corresponding to these sizes. For types 2 and 3, the side and front faces of the texture are stretched 2 or 3 times, so these images are stored in compressed form.
It is assumed that within the texture arrays, textures will be grouped by different types of interiors and sizes within a single array. For example, in the 2x2x1, slots 0-7 can be office interiors, and 8-15 can be hallways, which will be assigned to the 4x4x2 type.

Furniture
Furniture is created as a separate "layer" during mapping, meaning that for each furniture layer, separate UV coordinates are provided. The squares with furniture (located at the corners of the texture) have alpha transparency, which is used for blending the furniture with the rest of the room.
Currently, two furniture layers are available: Furniture A and Furniture B. Each can have 4 positions. For simplicity, to avoid using separate parameters, position B is always opposite position to A.
Blinds
Blinds are created independently of the mapping. They use a separate 4x4 texture, and the required square is selected in the shader. If square 0 is selected, the blinds are completely disabled.
Optimization
To optimize, all parameters are encoded into a single number (float, 23 bits), which is passed to the shader through custom data. This is handled by the Bit Field Extraction block in the shader, which extracts all the necessary parameters for room settings from this number. Bitwise operations (BitFieldExtractU32()) are used here.
For convenience, a blueprint was created to convert numbers from different numeral systems, gathering manual parameters from the MI and packing them into a single decimal number: ni10 > ni2 > N2 > N10.
It is important to remember that the total size of the initial parameters should not exceed 23 bits, otherwise the result will be incorrect.
Cubemap Approach
My shader also achieves a parallax effect using a slightly different but very similar approach, relying solely on cubemaps instead of cross-layout textures.
<
>
MMSHVYREV@GMAIL.COM
+381 62 9758559
Novi Sad, Serbia
© 2024 Maksim Shvyrev
CV
Made on
Tilda