Jump to content

Unable to compile effect - Error


Pryme8
 Share

Recommended Posts

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.
 

Link to comment
Share on other sites

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.

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...