Jump to content

post processing shader cannot compile


phil1234
 Share

Recommended Posts

Hello ,

 

I try to use this code from the postprocessor tutorial

but it does not compile

var postProcess0 = new BABYLON.PassPostProcess("Scene copy", 1.0, camera); var postProcess4 = new BABYLON.PostProcess("Final compose", "./Scenes/Customs/postprocesses/compose", ["sceneIntensity", "glowIntensity", "highlightIntensity"], ["sceneSampler"], 1, camera);    postProcess4.onApply = function (effect) {        effect.setTextureFromPostProcess("sceneSampler", postProcess0);        effect.setFloat("sceneIntensity", 0.5);        effect.setFloat("glowIntensity", 0.4);        effect.setFloat("highlightIntensity", 1.0);    };

FFox console:

GETXHRhttp://localhost/system/Scenes/Customs/postprocesses/compose.fragment.fx [HTTP/1.1 404 Not Found 0ms]BJS - [08:55:50]: Unable to compile effect:  babylon.2.2.max.js:4861:13BJS - [08:55:50]: Vertex shader:postprocess babylon.2.2.max.js:4861:13BJS - [08:55:50]: Fragment shader:./Scenes/Customs/postprocesses/compose babylon.2.2.max.js:4861:13BJS - [08:55:50]: Defines:  babylon.2.2.max.js:4861:13BJS - [08:55:50]: Error: ERROR: 0:? : '' : syntax error babylon.2.2.max.js:4861:13Error: WebGL: shaderSource: String contains the illegal character '34'

any idea ?

 

thanks

Link to comment
Share on other sites

ok I figured out I had to add some files from the samples archive (missed the 404)

 

but I get a syntax error on the first line of the downsample shader in ffox

 

it goes away if I remove # lines but the screen is white and I get another misformed file error (as if the shader was interpreted as a json)

 

If I remove all commens, leaving just the code I get a syntax error at the first line

 

it seems the shader file is not interpreted the right way

Link to comment
Share on other sites

here you can test your shader code.

 http://www.babylonjs.com/cyos/

 

.......

 

and when I used shaders I added this line of code

BABYLON.Engine.ShadersRepository = "";

but I don't know if it's necesarely in your case

 

I know cyos,nothing to do with  the issue I posted

in my case the enigne does not recognize the file, it gives syntax error

it is a shader form babylon repository, not a shader I wrote

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...