godotengine / godot-blender-exporter

Addon for Blender to directly export to a Godot Scene
GNU General Public License v2.0
1.15k stars 129 forks source link

Support Geometry/Math shader nodes #280

Open rcorre opened 5 years ago

rcorre commented 5 years ago

OS:

Linux.

Godot version:

3.1.1.stable.custom_build

Blender version:

Blender 2.80 (sub 75)
    build date: 2019-09-03
    build time: 15:03:17
    build commit date: 2019-07-29
    build commit time: 14:47
    build hash: f6cb5f54494e
    build platform: Linux
    build type: Release
    build c flags:  -Wall -Wcast-align -Werror=implicit-function-declaration -Werror=return-type -Werror=vla -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wlogical-op -Wundef -Winit-self -Wnonnull -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Wformat-signedness -Wrestrict -Wuninitialized -Wredundant-decls -Wshadow -Wno-error=unused-but-set-variable -Wimplicit-fallthrough=5 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fuse-ld=gold -fopenmp -std=gnu11   -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -msse2
    build c++ flags:  -Wredundant-decls -Wall -Wno-invalid-offsetof -Wno-sign-compare -Wlogical-op -Winit-self -Wmissing-include-dirs -Wno-div-by-zero -Wtype-limits -Werror=return-type -Werror=implicit-function-declaration -Wno-char-subscripts -Wno-unknown-pragmas -Wpointer-arith -Wunused-parameter -Wwrite-strings -Wundef -Wformat-signedness -Wrestrict -Wuninitialized -Wundef -Wmissing-declarations -Wimplicit-fallthrough=5 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fuse-ld=gold -fopenmp -std=c++11   -msse -pipe -fPIC -funsigned-char -fno-strict-aliasing -msse2
    build link flags:  -Wl,--version-script='/build/blender/src/blender-2.80/source/creator/blender.map'
    build system: CMake

Issue description:

I'm exporting a scene with the following material:

1569321902

[WARNING]: input node 'Geometry' not supported,use default value for socket 'Vector'
[WARNING]: input node 'Math' not supported,use default value for socket 'Fac'

Minimal reproduction project:

example.zip

rcorre commented 5 years ago

The error message is misleading, as we actually do support some math nodes, but not greater/less-than. Those should be easy to add though.

I'm less sure about geometry.

rcorre commented 5 years ago

Also, there appears to be a typo (gotta run so just dropping this here so I don't forget, I can take a look at fixing this tonight):


    ShaderFunction(code="""
void node_math_no_clamp(float value1, float value2, out float result) {
    result = value1 +  value2;
}
"""),

    ShaderFunction(code="""
void node_math_subtract_no_clamp(float value1, float value2,
        out float result) {
    result = value1 - value2;
}
"""),

node_math_no_clamp should be node_math_add_no_clamp, I think

rcorre commented 5 years ago

Actually looks like #275 fixes the math nodes.