godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
88.71k stars 20.12k forks source link

No way to pass custom variables between Vertex and Fragment Shader #3268

Closed Krzycho666 closed 7 years ago

Krzycho666 commented 8 years ago

Since godot shading language is quite limited in some cases, there is no way to pass custom variables between Vertex and Fragment Shader. There are predefined variables VAR1 and VAR2 ( which are vec4, but it's only two of them. This makes writing optimized shaders impossible, since most of the calculations should be made in Vertex shader - but there is no way to pass them forward to Fragment one. Also arrays would make life a lot easier too.

reduz commented 8 years ago

problem is that old mobile devices can't do more than that. This will likely be fixed in the migration to GLES3

Krzycho666 commented 8 years ago

Wow. Seriously? "Attribute" and "varying" qualifiers are not supported on all devices with GLES2? It sounds quite odd to me. I'm not sure if we should care about it, since most likely it's just a couple of outdated and exotic devices. Besides this is a GLES2.0 core functionality - so as many other unimplemented in godot shading language things. In my opinion it should be added to GLES2 backend, but with some info added about the potential problems, with a list of known buggy devices/GPUs. Other users will have to pay quite big price for not implementing this in many cases. I've never seen any engine that would care about such problems, bannig very basic functionality.

Megalomaniak commented 7 years ago

@Krzycho666 in the meanwhile in shadergraph at least I've been using things like vertex colors and whatnot, any free/leftover carryovers to plug extra data from vertex program into the fragment program.

It's not a fix really but in some cases this can help.

reduz commented 7 years ago

built-in shader lang will be rewritten/improved for 3.0

On Thu, Sep 15, 2016 at 10:36 AM, quantum-entangler < notifications@github.com> wrote:

@Krzycho666 https://github.com/Krzycho666 in the meanwhile in shadergraph at least I've been using things like vertex colors and whatnot, any free/leftover carryovers to plug extra data from vertex program into the fragment program.

It's not a fix really but in some cases this can help.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/3268#issuecomment-247329612, or mute the thread https://github.com/notifications/unsubscribe-auth/AF-Z243AgX92o_kvcx3GpK-3Nm8mjL-gks5qqUnTgaJpZM4HApCD .

reduz commented 7 years ago

this happened and now you can use varying, closing