Hello Defold community it’s my first questions. I am developing mobile logic game for android and everything was fine until I tried custom render pipeline and new shaders for some effects. Unfortunately I was unable to debug even with help of chatgpt4 so I have to ask for help. I have fragment shader code like this
#version 100
// positions are in world space
attribute vec4 position;
attribute vec2 texcoord0;
uniform mat4 mtx_view;
uniform mat4 mtx_proj;
varying vec4 var_position;
varying vec2 var_texcoord0;
varying vec2 vPosition;
void main()
{
vec4 p = mtx_view * vec4(position.xyz, 1.0);
var_position = p;
var_texcoord0 = texcoord0;
vPosition = position.xy;
gl_Position = mtx_proj * p;
}
and I get following errors when I click build (defold version 1.7.0)
INFO:GRAPHICS: Installed graphics device 'ADAPTER_FAMILY_OPENGL'
INFO:ENGINE: Defold Engine 1.7.0 (bf4dc66)
INFO:DLIB: Initialized Remotery (ws://127.0.0.1:17815/rmt)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device 'default'
ERROR:GRAPHICS: Unable to compile fragment shader.
ERROR:GRAPHICS: 0:13(1): error: `out' qualifier in declaration of `_DMENGINE_GENERATED_gl_FragColor_0' only valid for function parameters in GLSL ES 1.00
0:13(1): error: No precision specified in this scope for type `vec4'
0:18(1): error: `in' qualifier in declaration of `var_texcoord0' only valid for function parameters in GLSL ES 1.00
0:27(39): error: no function with name 'texture'
0:27(39): error: operands to arithmetic operators must be numeric
WARNING:RESOURCE: Unable to create resource: /_generated_a9c6254a.fpc: FORMAT_ERROR
WARNING:RESOURCE: Unable to create resource: /assets/advancedEffects/defluid/defluid/metaball.materialc: FORMAT_ERROR
WARNING:RESOURCE: Unable to create resource: /_generated_cd621834.spritec: FORMAT_ERROR
WARNING:RESOURCE: Unable to create resource: /assets/advancedEffects/defluid/defluid/particle.goc: FORMAT_ERROR
double free or corruption (fasttop)
INFO:CRASH: Successfully wrote Crashdump to file: /home/karol/.Defold/_crash
ERROR:CRASH: CALL STACK:
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x6c7305]
ERROR:CRASH: /lib/x86_64-linux-gnu/libpthread.so.0(+0x14420) [0x7f7dc8d78420]
ERROR:CRASH: /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb) [0x7f7dc851b00b]
ERROR:CRASH: /lib/x86_64-linux-gnu/libc.so.6(abort+0x12b) [0x7f7dc84fa859]
ERROR:CRASH: /lib/x86_64-linux-gnu/libc.so.6(+0x8d26e) [0x7f7dc856526e]
ERROR:CRASH: /lib/x86_64-linux-gnu/libc.so.6(+0x952fc) [0x7f7dc856d2fc]
ERROR:CRASH: /lib/x86_64-linux-gnu/libc.so.6(+0x96c65) [0x7f7dc856ec65]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x471079]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x443d03]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x4442f8]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x436922]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x436598]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x443d03]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x4442f8]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x435c2a]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x435800]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x443d03]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x4442f8]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x4551eb]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x426de1]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x638566]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x42786b]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x425d41]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x417d5b]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x418dd3]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x415111]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x415085]
ERROR:CRASH: /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f7dc84fc083]
ERROR:CRASH: /home/karol/.Defold/unpack/9ad2d7834a6adfaedcd902a8e6f9997ed5cbb507/x86_64-linux/bin/dmengine() [0x414ece]
ERROR:CRASH:
It started when I added #version 100 at the top. Before it was working fine on linux ubuntu LTS 20 fine but unfortunately got black screen on android redmi 9 so I triend made shader proper for android device (I do it first time and this line was hinted by chat gpt4)
I added in total two custom fp and two vs. I upload more minimalistic version of my project you can find scripts related to shaders in assets/advancedEffects/defluid/defluid/ which are files like render_target.vp/fp and metaball.vp/fb and their materials. My need is to make shaders work on android smartphones. Thank you in advance