armory3d / armory

3D Engine with Blender Integration
https://armory3d.org/engine
zlib License
3.07k stars 316 forks source link

fragColor declared a second time as array in translucent shader #765

Closed Disar closed 6 years ago

Disar commented 6 years ago

All of a sudden the glsl is declared with

out vec4 fragColor;
out vec4[2] fragColor;

by using this setup

The array field is used, the first one is not.

Disar commented 6 years ago

I think the build tools choked on me holding the build folder hostage preventing from writing the proper file? Is this a known issue?

I was able to delete the folder manually after closing the right processes. It compiles now.

luboslenco commented 6 years ago

Is the issue gone? If not can throw me the blend file for that material?

Disar commented 6 years ago

Issue appears to be gone. It's a bit tricky what actually fails. At the start of my project vertex displacement didn't compile, tessellation did. But now vertex displacement appears to be fine. But in this case it was just the folder being hijacked by a process ( or something )

I might have a hunch so best I ask here tho. If you have a node with color output but connect that to a float input, might this cause some shader fails?

Ill have to do a few tests on this but I do't know how sensitive the parser.

Disar commented 6 years ago

I'm closing this. If I find something similar to what I described ill open new issue.

Disar commented 6 years ago

When I set the render path preset to "mobile" I get

ERROR: E:\Files\Blender\Blocko\build_gear\compiled\Shaders\Material_mesh.frag.glsl:33: 'n' : redefinition ERROR: E:\Files\Blender\Blocko\build_gear\compiled\Shaders\Material_mesh.frag.glsl:33: '' : compilation terminated

Material looks like this

https://i.imgur.com/aZfgmnR.png

Output file :

https://hastebin.com/jajixefufa.glsl

luboslenco commented 6 years ago

Issue with mobile preset should be fixed https://github.com/armory3d/armory/commit/bcfb9e34fee992225816b02be2c2ae08ba25bf91.

Disar commented 6 years ago

Sorry to bother you with this one but the problem persists when enabling "blending" in the render path and materials..

luboslenco commented 6 years ago

Uh oh, what render path setup? Seems ok here, must get triggered by something.

Disar commented 6 years ago

So it builds fine with blending mode on, it doesn't like it when I enable blending in the material.

luboslenco commented 6 years ago

Can you share the material? Or it is the same one pasted above?

Disar commented 6 years ago

https://i.imgur.com/46NaKqp.png

As you can see there isn't much to it.

Btw: "receive shadow" is no longer visible. Might be a result of switching between celshading/armory?

luboslenco commented 6 years ago

Nice, was caused by opacity socket + enabled blending. Pushed a fix and exposed blending settings in material props but needs testing.

Disar commented 6 years ago

awww yish. Now I just have to fine the correct combinations. Thanks!