Armory PBR issue material not compiling
- Dominant language
- C++
- Stars
- 3.3k
- Forks
- 353
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 1
Description
Blender 2.93.9
last github repo
windows 10
Project example : https://github.com/onelsonic/armory_tests/raw/master/armoryPBRmat.7z
In Blender if we use a "Principled BSDF" material node everything works fine.
But when using the "Armory PBR" material node when there is a need to move around the "Armory PBR" material node in a few effects the project will simply not compile.
While the "Armory PBR" material node is required for proper normal mapping we cannot use it currently in more advanced material.
When trying so the compilation will throw errors.
Some variables corresponding to other material nodes present in the material in Blender (like : Seperate RGB or MIX RGB) in the GLSL code are used before their own declaration which throw some errors at the compilation.
```
Scene exported in 0.018s
Info: Publishing project, check console for details.
ERROR: C:\armoryPBRmat_mesh.frag.glsl:13: 'Mix_Color_res' : undeclared identifier
ERROR: C:\armoryPBRmat_mesh.frag.glsl:13: 'assign' : cannot convert from ' temp float' to ' temp 3-component vector of float'
ERROR: C:\armoryPBRmat_mesh.frag.glsl:13: '' : compilation terminated
ERROR: 3 compilation errors. No code generated.
```
if you look at the GLSL code :
https://github.com/onelsonic/armory_tests/blob/master/armoryPBRmat/build_armoryPBRmat/compiled/Shaders/armoryPBRmat_mesh.frag.glsl
Mix_Color_res is first used at line 13
but only declared later at line 25 ??
It seems there are issues with the way materials are exported from Blender.
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the issue with the linked armoryPBRmat.7z project in Blender 2.93.9, then inspect build_armoryPBRmat/compiled/Shaders/armoryPBRmat_mesh.frag.glsl and the reported Mix_Color_res ordering. Trace how the Armory PBR material is exported and confirm that the generated shader compiles without undeclared-variable errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- blender
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100