Fragment shader error using Needle Engine with OutputPass?

Hi, I want to use as postprocessing OutputPass. Unfortunately I get an error? With SSRPass it works.

const outputPass = new OutputPass();
composer.addPass(outputPass);
this.context.composer = composer;

THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false

Material Name: OutputShader
Material Type: RawShaderMaterial

Program Info Log: Fragment shader is not compiled.

FRAGMENT

ERROR: 0:97: ‘12.47393f’ : Floating-point suffix unsupported prior to GLSL ES 3.00
ERROR: 0:97: ‘12.47393f’ : syntax error

92: const mat3 agx_mat = mat3(
93: 0.842479062253094, 0.0423282422610123, 0.0423756549057051,
94: 0.0784335999999992, 0.878468636469772, 0.0784336,
95: 0.0792237451477643, 0.0791661274605434, 0.879142973793104);
96:

97: const float min_ev = -12.47393f;
98: const float max_ev = 4.026069f;
99:
100: // val = pow(val, vec3(2.2));
101:
102: // Input transform (inset)
103: val = agx_mat * val;

My Needle Engine (3.51.4 free version) Renderer is WEBGL2.0 and GLSL ES 3.00. So Floating-point suffix should be not a problem.

What I’m doing wrong? Thanks…

Hello Armin,

The error you’re encountering in the fragment shader indicates that the floating-point suffix (f) is not supported in the GLSL ES 3.00 version you are using. This is likely due to the fact that the shader code should not include the f suffix for floating-point literals in versions prior to GLSL ES 3.00 unless properly configured.

Here’s the specific line in the error message:

const float min_ev = -12.47393f;

You should modify that line by removing the f suffix:

const float min_ev = -12.47393;

Make similar adjustments for all floating-point constants in your shader code to ensure they do not include the f. Here’s how you can update the critical lines:

const float min_ev = -12.47393;   // Remove the 'f'
const float max_ev = 4.026069;    // Remove the 'f' as well if it exists

After making these changes, please recompile the shader and see if the error persists. If you encounter further issues, please let me know!

In the meantime, you might want to review the shader version compatibility and check whether there are any additional changes in shaders related to Needle Engine or the configuration of your output pass in the documentation.

You can find additional useful references in the documentation for Post-Processing and Shader usage to ensure everything aligns with the current settings and API version you are using.

If you need more help with specific lines or configurations, feel free to ask!

1 replies left - Get a PRO license for more AI replies.
thread_taLy4fSl9sS5Pd5IWmU9lgYC
Reply to this message to continue the conversation

Hi, please check my reply here: How to use SSR in Needle Engine? - #6 by marwie1

Found a solution:

  1. Search with grepfile for “const float min_ev = -12.47393f;”
    => Files engine_tonmapping.js and .ts
  2. Change code to “const float min_ev = -12.47393; const float max_ev = 4.026069;”
  3. Save files
  4. Remove alle files in node_modules/.vite/deps

@Armin_Fuchs for completeness, exactly that change has landed a while ago in 4.3.2 after you raised this issue.

Is my understanding correct that because you’re using Needle from Blender, you can’t update to the 4.x version at the moment?

Correct.

1 Like

Hello Armin,

could you try and download the Blender Addon version 0.60.0 from this URL?

https://engine.needle.tools/downloads/blender/ea/

This is the early access version and will install the latest Needle Engine version (currently 4.4.0-beta.6) which should fix the issue for you.

Hi marwie1,
just installed Blender Plugin 0.60.0. in Blender 4.2.8.


Unfortunately Blender hangs at opening/selecting e.g. Addon Window (screenshot) or Scene Properties Window. Tested it also with an empty project. Must go back to
image

Hi Armin, thanks for testing. Which OS are you working on?

Hi marwie1, WIN 10…