Sign in to follow this  
max123

Custom vertex + default fragmet shader

Recommended Posts

Hi,

Is it possible to use your own vertex shader and use the default fragment shader, leke so:

shaderMat = new BABYLON.ShaderMaterial("shader-123", scene, {
        vertexElement: "vertexShaderX",
        fragmentElement: ???, // Need to use the default shader!
    },
    {
        attributes: ["position", "normal", "uv", "vUV"],
        uniforms: ["world", "worldView", "worldViewProjection", "view", "projection"]
    });

 

Cheers!

Share this post


Link to post
Share on other sites

Hello,

yes you can, just do something like:

shaderMat = new BABYLON.ShaderMaterial("shader-123", scene, {
        vertexElement: "vertexShaderX",
        fragmentElement: "default", // Need to use the default shader!
    },
    {
        attributes: ["position", "normal", "uv", "vUV"],
        uniforms: ["world", "worldView", "worldViewProjection", "view", "projection"]
    });

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.