bevyengine / bevyengine/bevy

Support Detail maps in StandardMaterial

Open
#11,972 1 comment 0 reactions 0 assignees View on GitHub
A-Rendering C-Feature
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## What problem does this solve or what need does it fill?

Detail maps (also known as Secondary maps) are a common technique in video games used to give materials higher detail when viewed at close distances.

_From [Unreal Engine](https://docs.unrealengine.com/5.3/en-US/adding-detail-textures-to-unreal-engine-materials/)_

> Detail texturing allows you to give the illusion of more detail in a texture by bringing in a more highly repeated diffuse and normal map combination which layers over the original diffuse and normal for an object. This gives the illusion of greater detail at close range.

![image](https://github.com/bevyengine/bevy/assets/2771466/01ad0c78-0c5f-4e49-8e80-bf6cd61c17c5)

> On the left side (labeled 1), the Material uses a detail texture to add additional high-frequency details to the surface. On the right side (labeled 2) the Material does not use a detail texture. Note that the image on the left appears sharper and more detailed than the image on the right.

## What solution would you like?

`StandardMaterial` should support optional diffuse and normal map inputs which contribute to the rendering of the material. Additional inputs such as a mask, scale controls, intensity, blend mode, tiling, and offset could impact the exact way the detail map is applied.

## What alternative(s) have you considered?

Custom shader or `ExtendedMaterial`.

## Additional context

Surveying the "big 3" shows details maps as being supported in the base "standard material" in both [Unity](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@17.0/manual/lit-shader.html#detail-inputs) and [Godot](https://docs.godotengine.org/en/4.2/tutorials/3d/standard_material_3d.html#detail), while [Unreal](https://docs.unrealengine.com/5.3/en-US/texturing-material-functions-in-unreal-engine/#detailtexturing) moves this responsibility to a "Texturing Function" in their node based material workflow.

Contributor guide

Open the contributing guide

Research direction

Start by locating StandardMaterial and its material rendering path. Define how optional diffuse and normal detail maps should interact with the base material, including the requested masking, scaling, intensity, blending, tiling, and offset controls. Done means StandardMaterial supports the agreed detail-map behavior and its rendering is verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.