I noticed that my node materials are not shaded correctly in my build Editor project.
Standard and PBR Materials work just fine, since the textures are added in the asset/textures tab and set in the materials slots. Textures uploaded in a texture node in the node editor are not loading in my build project. It think he tries to load the textures as a file (data:octet/stream;base 64) and not as a texture. I attached screenshots.
Using “Embed static texture” will embed the data in the file so it should work.
[…] Just saw your screenshot. It’s strange, the url is not trapped and transformed by Chrome, it’s going to the web server… I think it’s the /scenes/scene prefix which is the problem, you should try to remove it.
A collegue was able to help me searching for the error.
We opened the scene.babylon file in the editor and the prefix isn´t there yet. So the Editor builds the project correctly and “embed static texture” in the node editor works fine.
The Root URL ./Scenes/scene is added somewhere on the way in the viewer/browser.
rootUrl is passed by your code, either when calling loadFromSerialization or Parse or ParseFromSnippetAsync. Make sure that in your code you pass an empty string for this parameter.
I don´t really “have” code. I am working in the Windows Editor. I just build my project directly out of the editor and start the index file using a browser to view it.
Hey @Evgeni_Popov and @DIO
If the rootUrl looks like “./scenes/scene_name” it means that the material is being parsed using the SceneLoader.
Loading a scene requires to pass a rootUrl parameter (in order to load resources for standard materials, pbr materials, etc.). I think the bug comes more from the NodeMaterial.Parse function that doesn’t check if the data is a baase64 or simple a file path before adding the rootUrl to it.
As an example, having a .babylon scene we would love to do “await SceneLoader.Append(”./scenes/scene/", “my_scene.babylon”)"
Hey @Evgeni_Popov I’m on it and I just saw these lines as well (and looks like it was my lines on a PR I did in past ahahah).
What I’m experiencing right now is that serialized textures have empty “url” property but have their “name” property containing the dataUrl. Strange, maybe a change on textures recently? Because that means the .name property should be checked instead of the .url property. I’m also checking if I’m not doing something strange on my side in the Editor.
@DIO I found a workaround for the moment in the Editor, I’ll share with you a build to solve your problem (I’m forcing serialized materials to tell that url begins with a “data:” (dataUrl style) and it works well).
@Evgeni_Popov you are right, I saw that cube textures have both name and url having the dataUrl (which repeats the same data and growths the size of the JSON ^^)