Models created via a script behave unexpectedly with materials that have a normal map
See original GitHub issueRelease 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 Pack
asset 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.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Models created via a script behave unexpectedly with ...
To Reproduce Steps to reproduce the behavior: Open Xenko Launcher. ... script behave unexpectedly with materials that have a normal map #413.
Read more >Help! Normal Map Suddenly appearing weird
Problem: My normal map renders out fine in 3ds Max , however I noticed that when I rotated the 3d model which had...
Read more >Unexpected results with normal map - Talk
I have a wall texture I'd like to use as a normal map but it isn't behaving as I'd expect. Specifically, shadows and...
Read more >PBR Textures | Documentation - Roblox Creator Hub
This guide provides instructions on setting up your mesh objects to use PBR textures maps and describes common use-cases and best practices for...
Read more >Accidentally Painting Normal Map
I recently baked a normal map from a high poly to a low poly, and then set up the normal map in the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found solution in Blender when exporting FBX files! It’s under the Geometries tab, at the bottom – make sure “Tangent Space” is checked on:
At the very least, the documentation should be updated to correctly explain how to create a sphere that contains tangent data… since right now it advocates using:
https://doc.xenko.com/latest/en/manual/scripts/create-a-model-from-code.html