Materials & Shader Graph
A material is a .tmaterial asset that drives how a surface looks. It is bound to
a mesh through a MaterialComponent (one slot per submesh),
and edited in the editor's node-based Material editor.
PBR surface
Materials are physically-based. The core inputs:
| Input | Meaning |
|---|---|
| Albedo | Base colour (tint, or multiplied with the albedo texture). |
| Albedo map | Base-colour texture. |
| Metallic / Roughness (MR) map | Metalness and microsurface roughness. |
| Normal map | Tangent-space normals — the derivative TBN reconstructs the basis, so no vertex tangents are needed. |
| AO map | Baked ambient occlusion. |
| Emissive | Self-illumination (feeds bloom in the HDR pipeline). |
| Tiling | Independent X/Y UV repeat (a vec2). |
Shader Graph
The Material editor is a real shader graph: it generates shader source (HLSL — compiled to SPIR-V through DXC on Vulkan) from the node network and compiles a shader per material — not a set of CPU constants. Nodes feed the Material Output node, which also hosts the MR/AO map pins plus inline tiling, emissive intensity and a UsePBR toggle. Texture nodes sample real textures; math/UV/constant nodes combine into the final surface.
Laying out wires
Double-click a wire (or right-click it ▸ Add a bend here) to drop a dot on it, Blender's Reroute. Drag the dot to route the wire around nodes. One dot can feed several inputs. Deleting a dot joins the wire back together instead of cutting it. Dots cost nothing: the shader generated with them is byte for byte the one without.
Same names, same numbers as Blender
The nodes are named and behave as Blender's, so a value read off a .blend means the
same here. The editor shows Blender's name; the material file keeps the engine's stable one, so
renaming in the UI never breaks a saved material.
| Blender | Here (stable name) | Notes |
|---|---|---|
| Principled BSDF | Principled BSDF | Base / Specular / Coat / Sheen / Emission. Emission defaults white at strength 0, as in Blender. |
| Image Texture | Texture Sample | Outputs Color and Alpha. |
| Normal Map, Bump, Displacement | same | Tangent / Object / World; OpenGL or DirectX green. |
| Math | Math | All 41 operations, Blender's formulas including the safe ones (x / 0 = 0, √ of a negative = 0), Clamp. |
| Map Range | Map Range | Linear, Stepped, Smooth Step, Smoother Step; Clamp. |
| Clamp | Clamp | Min Max or Range. |
| Mix (float) | Lerp | Factor clamped to 0..1, like Blender's Clamp Factor. |
| Fresnel | Fresnel IOR | The dielectric equation with IOR (1.45). The older Fresnel (Power) is a rim curve. |
| RGB to BW | RGB to BW | Rec.709 luminance. |
| Color Ramp | Color Ramp | Up to 32 stops with alpha; Linear, Constant, Ease. Checked against Blender 4.5: identical. B-Spline, Cardinal and the HSV/HSL colour modes are not here. |
| Noise Texture | Noise Texture | 3D fBM with Scale, Detail, Roughness, Lacunarity, Distortion and Normalize, ported from Cycles. Fac and Color match Blender 4.5 to about 1e-5. An unconnected Vector is the world position, not Blender's Generated coordinates, so wire a coordinate in if you need the pattern to follow the object. |
| Vector Math | Vector Math | All 29 operations with Cycles' safe variants (x / 0 = 0, zero normalises to zero). Checked against Blender 4.5: identical. Modulo by 0 is 0, as in Cycles; Geometry Nodes gives NaN there. |
| Mapping | Mapping | Point, Texture, Vector, Normal; rotation in degrees, Euler XYZ. Identical to Cycles renders. |
| Hue/Saturation/Value | Hue Saturation Value | Cycles' HSV conversion, negative results clamped to 0. Identical to Cycles renders. |
| Voronoi Texture | Voronoi Texture | 3D: F1, F2, Smooth F1, Distance to Edge; Euclidean / Manhattan / Chebychev / Minkowski; Detail, Roughness, Lacunarity, Randomness, Normalize. Distance, Color and Position identical to Blender 4.5. No 1D/2D/4D, W or N-Sphere Radius. An unconnected Vector is the world position. |
| Texture Coordinate | Texture Coordinate | Generated, Normal (object space), UV, Object, Reflection. Generated is the object coordinates, not normalised to the bounding box. No Camera or Window output. |
| Invert, Separate / Combine Color | One Minus, Split / Combine | |
| Value, RGB, UV Map, Geometry (Position / Normal / Incoming) | Float, Color, UV, World Position / Vertex Normal / View Direction |
Material instances
An instance shares a parent material's graph and compiled shader and overrides only the exposed
parameters — so you get many variants (fifty crates, one shader) without duplicating the graph.
Create one from the Content Browser (right-click a .tmaterial ▸ Create Material
Instance); it stores a Parent path and its own parameter overrides.
Texture mapping
Material Editor › Mapping chooses where texture coordinates come from:
- Mesh UVs (default): the model's own UVs, times Tiling.
- Box projection (per metre): the texture is laid onto the object from its sides, top and front, with its Scale included, so it keeps its size when the entity is scaled. A cube's UVs run 0..1 on every face at any Scale, so a cube stretched into a 50 m floor would stretch one texture across all of it. Tiling becomes repeats per metre. Use it for floors, walls and blockout; the mesh's UVs are ignored. On rounded meshes the edges between projected faces show.
An entity with no material is drawn with the grey checkerboard, box-projected so that one square is one metre at any scale. It doubles as a ruler while blocking out.
Terrain materials
Terrain layers reference ordinary .tmaterial
assets — the material's albedo/MR/normal feed the terrain shader, with a per-layer tiling override
so one material can repeat differently on the ground than on a wall.
See also
Materiały i graf shaderów
Materiał to asset .tmaterial, który decyduje o wyglądzie powierzchni. Do siatki
przypina go MaterialComponent (jeden slot na podsiatkę), a
edytujesz go w węzłowym edytorze materiałów.
Powierzchnia PBR
Materiały są oparte na fizyce (PBR). Główne wejścia:
| Wejście | Znaczenie |
|---|---|
| Albedo | Kolor bazowy (odcień albo mnożnik tekstury albedo). |
| Mapa albedo | Tekstura koloru bazowego. |
| Mapa Metallic / Roughness (MR) | Metaliczność i chropowatość mikropowierzchni. |
| Mapa normalnych | Normalne w przestrzeni stycznej — bazę odtwarza TBN z pochodnych, więc styczne wierzchołków nie są potrzebne. |
| Mapa AO | Wypieczona okluzja otoczenia. |
| Emissive | Samoświecenie (zasila bloom w potoku HDR). |
| Tiling | Niezależne powtarzanie UV w X/Y (vec2). |
Graf shaderów
Edytor materiałów to prawdziwy graf shaderów: generuje kod shadera (HLSL — kompilowany do SPIR-V przez DXC na Vulkanie) z sieci węzłów i kompiluje shader dla każdego materiału — a nie zestaw stałych na CPU. Węzły zasilają węzeł Material Output, który ma też piny map MR/AO oraz wbudowany tiling, intensywność emisji i przełącznik UsePBR. Węzły tekstur próbkują prawdziwe tekstury; węzły matematyczne, UV i stałe składają się w końcową powierzchnię.
Układanie połączeń
Kliknij dwa razy połączenie (albo prawy przycisk ▸ Add a bend here), żeby postawić na nim kropkę, czyli Reroute z Blendera. Przeciągnij kropkę, żeby poprowadzić kabel wokół węzłów. Z jednej kropki może wychodzić kilka połączeń. Usunięcie kropki łączy kabel z powrotem zamiast go przecinać. Kropki nic nie kosztują: shader wygenerowany z nimi jest bajt w bajt taki sam jak bez nich.
Te same nazwy i liczby co w Blenderze
Węzły nazywają się i działają jak w Blenderze, więc wartość odczytana z pliku .blend
znaczy tu to samo. Edytor pokazuje nazwę z Blendera, a plik materiału zapisuje stałą nazwę silnika —
zmiana nazwy w UI nigdy nie psuje zapisanego materiału.
| Blender | Tutaj (nazwa w pliku) | Uwagi |
|---|---|---|
| Principled BSDF | Principled BSDF | Base / Specular / Coat / Sheen / Emission. Emisja domyślnie biała z siłą 0, jak w Blenderze. |
| Image Texture | Texture Sample | Wyjścia Color i Alpha. |
| Normal Map, Bump, Displacement | te same | Tangent / Object / World; zielony kanał OpenGL albo DirectX. |
| Math | Math | Wszystkie 41 operacji, wzory Blendera razem z „bezpiecznymi” (x / 0 = 0, pierwiastek z ujemnej = 0), Clamp. |
| Map Range | Map Range | Linear, Stepped, Smooth Step, Smoother Step; Clamp. |
| Clamp | Clamp | Min Max albo Range. |
| Mix (float) | Lerp | Współczynnik ograniczony do 0..1, jak Clamp Factor w Blenderze. |
| Fresnel | Fresnel IOR | Równanie dielektryka z IOR (1.45). Starszy Fresnel (Power) to krzywa obrysu. |
| RGB to BW | RGB to BW | Luminancja Rec.709. |
| Color Ramp | Color Ramp | Do 32 punktów z alfą; Linear, Constant, Ease. Porównane z Blenderem 4.5: identyczne. Nie ma B-Spline, Cardinal ani trybów kolorów HSV/HSL. |
| Noise Texture | Noise Texture | fBM 3D ze Scale, Detail, Roughness, Lacunarity, Distortion i Normalize, przeniesione z Cycles. Fac i Color zgadzają się z Blenderem 4.5 z dokładnością ok. 1e-5. Niepodłączony Vector to pozycja w świecie, a nie współrzędne Generated z Blendera, więc jeśli wzór ma podążać za obiektem, podłącz własne współrzędne. |
| Vector Math | Vector Math | Wszystkie 29 operacji z bezpiecznymi wariantami z Cycles (x / 0 = 0, zerowy wektor normalizuje się do zera). Porównane z Blenderem 4.5: identyczne. Modulo przez 0 daje 0, jak w Cycles; Geometry Nodes daje tam NaN. |
| Mapping | Mapping | Point, Texture, Vector, Normal; obrót w stopniach, Euler XYZ. Identyczne z renderami Cycles. |
| Hue/Saturation/Value | Hue Saturation Value | Konwersja HSV z Cycles, ujemne wyniki obcięte do 0. Identyczne z renderami Cycles. |
| Voronoi Texture | Voronoi Texture | 3D: F1, F2, Smooth F1, Distance to Edge; Euclidean / Manhattan / Chebychev / Minkowski; Detail, Roughness, Lacunarity, Randomness, Normalize. Distance, Color i Position identyczne z Blenderem 4.5. Nie ma 1D/2D/4D, W ani N-Sphere Radius. Niepodłączony Vector to pozycja w świecie. |
| Texture Coordinate | Texture Coordinate | Generated, Normal (w przestrzeni obiektu), UV, Object, Reflection. Generated to współrzędne obiektu, nieznormalizowane do bryły otaczającej. Nie ma wyjść Camera ani Window. |
| Invert, Separate / Combine Color | One Minus, Split / Combine | |
| Value, RGB, UV Map, Geometry (Position / Normal / Incoming) | Float, Color, UV, World Position / Vertex Normal / View Direction |
Instancje materiałów
Instancja dzieli graf i skompilowany shader materiału nadrzędnego i nadpisuje tylko wystawione
parametry — dostajesz wiele wariantów (pięćdziesiąt skrzyń, jeden shader) bez duplikowania grafu.
Utworzysz ją w Content Browserze (prawy klik na .tmaterial ▸ Create Material Instance);
zapisuje ścieżkę Parent i własne nadpisane parametry.
Mapowanie tekstur
Material Editor › Mapping wybiera, skąd biorą się współrzędne tekstury:
- Mesh UVs (domyślnie): własne UV modelu razy Tiling.
- Box projection (per metre): tekstura jest nakładana na obiekt z boków, z góry i z przodu, ze skalą włącznie, więc zachowuje rozmiar, gdy encję się skaluje. UV kostki idą od 0 do 1 na każdej ścianie przy dowolnej skali, więc kostka rozciągnięta w 50-metrową podłogę rozciągnęłaby jedną teksturę na całą długość. Tiling oznacza wtedy powtórzenia na metr. Do podłóg, ścian i blockoutu; UV meshu są ignorowane. Na zaokrąglonych meshach widać krawędzie między rzutowanymi ścianami.
Encja bez materiału rysuje się szarą szachownicą, rzutowaną pudełkowo tak, że jedno pole to jeden metr przy dowolnej skali. Przy blockoucie służy też za miarkę.
Materiały terenu
Warstwy terenu wskazują zwykłe assety .tmaterial —
albedo/MR/normalne materiału zasilają shader terenu, z nadpisaniem tilingu per warstwa, więc jeden
materiał może się powtarzać inaczej na ziemi niż na ścianie.