Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blender 3.6 - custom shader OpenGL ES version not compiling #2903

Open
onelsonic opened this issue Jul 7, 2023 · 4 comments
Open

Blender 3.6 - custom shader OpenGL ES version not compiling #2903

onelsonic opened this issue Jul 7, 2023 · 4 comments
Labels
bug This issue describes a bug

Comments

@onelsonic
Copy link
Contributor

onelsonic commented Jul 7, 2023

Description
Using custom some shaders in Armory as described here : https://github.com/armory3d/shader_pack
do not work anymore since upgrading to Blender 3.6 and latest version.
The file and shader using the OpenGL ES 310 version is compiling correctly when using Blender 3.3 with the previous repo, but stop working with the latest version.

To Reproduce
add a custom shader in a material and set the shader to
#version 310 es

Expected behavior
In this example, it is a simple grass shader with wind.
Animation

System
Blender: 3.6
Armory: current repo
OS: win10

Test File
Test file Bundle source :
https://github.com/onelsonic/armory_tests/raw/master/custom_shader.7z

When compiling with Blender and latest repo the shader compilation will crash with the following error : 
Unable to parse built-ins
`
`
ERROR: 0:2798: 'redefinition of built-in function' : not supported with this profile: es
INTERNAL ERROR: Unable to parse built-ins

..
..
..

ERROR: C:\custom_shader\compiled\Shaders\Project\GrassMaterial.frag.glsl:17: 'texture' : no matching overloaded function found
ERROR: C:\custom_shader\compiled\Shaders\Project\GrassMaterial.frag.glsl:17: '' : compilation terminated
ERROR: 2 compilation errors.  No code generated.


ERROR: Linking fragment stage: Missing entry point: Each stage requires one entry point

SPIR-V is not generated for failed compile or link

Compiling shader 1 of 2 (GrassMaterial.frag.glsl) failed:
Shader compiler error.
(node:6348) UnhandledPromiseRejectionWarning: Shader compiler error.
(node:6348) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:6348) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Finished in 2.955s
ERROR: Build failed, check console
@onelsonic onelsonic added the bug This issue describes a bug label Jul 7, 2023
@onelsonic
Copy link
Contributor Author

changing the format of the shader to opengl #version 450 seems to work but then we cannot render the shader correctly on mobile device.
#version 310 es is not supported anymore

@onelsonic onelsonic changed the title Blender 3.6 - custom shader not working anymore Blender 3.6 - custom shader OpenGL ES version not working compiling Jul 8, 2023
@onelsonic onelsonic changed the title Blender 3.6 - custom shader OpenGL ES version not working compiling Blender 3.6 - custom shader OpenGL ES version not compiling Jul 8, 2023
@e2002e
Copy link
Contributor

e2002e commented Jul 14, 2023

Just taking in look in the glsl reference, 2D textures need vec2 coordinates, you'r passing a vec3.

@onelsonic
Copy link
Contributor Author

Just taking in look in the glsl reference, 2D textures need vec2 coordinates, you'r passing a vec3.

vec3 is used for the color and vec2 for the texture.
changing the format of the glsl shader to #version 450 will work correctly.
We need to be able to change the shader format to #version 310 es when compiling the project with Armory

@e2002e
Copy link
Contributor

e2002e commented Aug 27, 2023

The compiler is telling that either texture() is not defined, or passed the wrong arguments. Can you check the glsl es reference and make sure the arguments are correct ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a bug
Projects
None yet
Development

No branches or pull requests

2 participants