Models created via a script behave unexpectedly with materials that have a normal map
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Release Type: Official Release
Version: 3.0.0.8 & 3.1
Platform(s): Windows
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
- Open Xenko Launcher.
- Create a new Project -
New game. Include theMaterials Packasset pack. - Create a new empty entity.
- Create a new script with the following code:
using Xenko.Engine;
using Xenko.Extensions;
using Xenko.Graphics.GeometricPrimitives;
using Xenko.Rendering;
public class MeshScript : SyncScript
{
public Material Material
{
get;
set;
}
// Declared public member fields and properties will show in the game studio
public override void Start()
{
var meshDraw = GeometricPrimitive.Sphere.New(this.GraphicsDevice).ToMeshDraw();
var mesh = new Mesh() { Draw = meshDraw };
var model = new Model();
model.Meshes.Add(mesh);
model.Materials.Add(this.Material);
var modelComponent = this.Entity.GetOrCreate<ModelComponent>();
modelComponent.Model = model;
}
public override void Update()
{
// Do stuff every new frame
}
}
- Add the script to the empty entity.
- Assign a PBR texture from the pack (such as
Materials/brick/brick). Seems to only affect materials with a normal map. - Build and run the game.
Expected behavior
A sphere to appear in game rendered with the specified material.
Screenshots

Disabling Bright Filter post-processing:

Disabling Surface normal map on brick texture:

Log and callstacks
n/a
Additional context
Disabling all post-processing removes the black artifacts but the model renders in all black.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the supplied ReproProject.zip and the MeshScript example, reproducing the generated sphere with the Materials Pack brick material and its normal map. Compare behavior with Bright Filter, other post-processing disabled, and the surface normal map removed; done means the procedural model renders correctly with the normal-mapped material.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- computer-graphics, game-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100