Pryme8 Posted February 18, 2016 Share Posted February 18, 2016 I am trying desperately to get my own shaders written and have gotten to the point in my research where I understand the process. Now I have gotten to trying to deploy them and actually script them up but I am being restricted from progressing because of this error: syntax error standardTeriableColor.vertex.fx:1:1 syntax error standardTeriableColor.fragment.fx:1:1 BJS - [08:14:19]: Unable to compile effect: babylon.js:3:14445 BJS - [08:14:19]: Vertex shader:./Shaders/standardTeriableColor babylon.js:3:14445 BJS - [08:14:19]: Fragment shader:./Shaders/standardTeriableColor babylon.js:3:14445 BJS - [08:14:19]: Defines: babylon.js:3:14445 BJS - [08:14:19]: Error: ERROR: 0:16: '' : syntax error babylon.js:3:14445 It is saying that the ";" in the first line of the shader is an unexpected character. Im wondering if it is because I saved them through Dreamweaver and perhaps that broke them? I will try rewriting and saving them through notepad and see what happens... here is the script that calls the shader in case I am missing something here! var TERIMAT = new BABYLON.ShaderMaterial("standardTeriableColor", scene, "./Shaders/standardTeriableColor", { attributes: ["position", "uv"], uniforms: ["worldViewProjection"] }); TERIMAT.setTexture("textureSampler", new BABYLON.Texture("./Shaders/standardTeriableColor/beach.jpg", scene)); this._ground.material = TERIMAT; TERIABLE.Region.push(this._ground); Also does a shader have to have reference textures? I mainly want to have just basic rgb (rgba if possible) colors assigned not a texture. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 18, 2016 Share Posted February 18, 2016 can you check with f12 tools that the shader files are loaded? Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted February 18, 2016 Author Share Posted February 18, 2016 syntax error standardTeriableColor.vertex.fx:1:1 syntax error standardTeriableColor.fragment.fx:1:1 BJS - [08:14:19]: Unable to compile effect: babylon.js:3:14445 BJS - [08:14:19]: Vertex shader:./Shaders/standardTeriableColor babylon.js:3:14445 BJS - [08:14:19]: Fragment shader:./Shaders/standardTeriableColor babylon.js:3:14445 BJS - [08:14:19]: Defines: babylon.js:3:14445 BJS - [08:14:19]: Error: ERROR: 0:16: '' : syntax error babylon.js:3:14445 is the exact copy from the f12 precision highp float; varying vec2 vUV; uniform sampler2D textureSampler; void main(void) { gl_FragColor = texture2D(textureSampler, vUV); } precision highp float; // Attributes attribute vec3 position; attribute vec2 uv; // Uniforms uniform mat4 worldViewProjection; // Normal varying vec2 vUV; void main(void) { gl_Position = worldViewProjection * vec4(position, 1.0); vUV = uv;// JavaScript Document are the shader files right now. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 18, 2016 Share Posted February 18, 2016 I meant: the F12 netwook tool to see if the file is loaded from your server Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted February 18, 2016 Author Share Posted February 18, 2016 Yes it did Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted February 19, 2016 Share Posted February 19, 2016 I'm afraid I will need a PG to keep helping you Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.