defold / defold

Defold is a completely free to use game engine for development of desktop, mobile and web games.
https://www.defold.com
Other
4.35k stars 308 forks source link

Shaders fail to compile in editor if flat keyword is used #9287

Open Wolfe2x7 opened 2 months ago

Wolfe2x7 commented 2 months ago

Describe the bug: Adding the flat keyword to a varying in a shader causes compilation to fail in the editor. The shader works as intended at runtime, with interpolation disabled, but in the editor, the model disappears.

To Reproduce: Steps to reproduce the behavior:

  1. Declare a varying as flat, like:
    flat varying vec4 my_varying;
  2. The shader will not compile in the editor, making objects with that material invisible

Expected behavior: The material should be visible in the editor.

Defold version: 1.9.1 Stable

Platforms: Linux Mint 21.2 Cinnamon

Wolfe2x7 commented 2 months ago

This issue still persists with shaders rewritten to use the new pipeline in version 1.9.2, with the syntax:

// my_shader.vp
flat out vec4 my_varying;

// my_shader.fp
flat in vec4 my_varying;

1.9.2 Beta 6918dc765019d446747e5ec55a9bedc2d13d88b6

EDIT: I've learned the bug I am seeing with the new shader pipeline is a different one, and not the same as this issue. I will open a separate issue for that bug.