0

Why does using glsl or defining functions in a SceneKit errors?


Asked By John Does

Posted on 4 years ago


Summary :

Huh? Why can't I use vec3? I've tried converting all vec3 to float3 manually, like this

Description:

Every time I attempt to write a SceneKit shader modifier, I get a pink screen and a debug screen filled with errors. According to the documents, I should be able to write a SceneKit shader modifier in glsl, but all I get is these errors like

Here Is My Code :
[SceneKit] Error: FATAL ERROR : failed compiling shader:
Error Domain=MTLLibraryErrorDomain Code=3 "Compilation failed: 

program_source:2847:41: error: expected parameter declarator
                                      , constant return& float3
                                        ^
program_source:2847:50: error: expected ')'
                                      , constant return& float3
                                                 ^
program_source:2732:38: note: to match this '('
fragment SCNOutput commonprofile_frag(commonprofile_io                 in                               [[ stage_in  ]]
                                     ^
program_source:3340:2: error: expected function body after function declarator
}
 ^
" UserInfo={NSLocalizedDescription=Compilation failed: 

program_source:2847:41: error: expected parameter declarator
                                      , constant return& float3
                                        ^
program_source:2847:50: error: expected ')'
                                      , constant return& float3
                                                 ^
program_source:2732:38: note: to match this '('
fragment SCNOutput commonprofile_frag(commonprofile_io                 in                               [[ stage_in  ]]
                                     ^
program_source:3340:2: error: expected function body after function declarator
}
Error Message :

error: use of undeclared identifier 'vec3'; did you mean 'vec'?



You have to Logged in to make answer !

Login Register