Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Can I write a Shadow shader with Vertex and Fragment Shaders in Unity4?

Discussion in 'Shaders' started by nugao, Mar 10, 2015.

  1. nugao

    nugao

    Joined:
    Nov 17, 2011
    Posts:
    20
    Hello.

    I want to write a Shadow shader with Vertex and Fragment Shaders, only Vertex and Fragment Shaders, no Surface shader.

    I have tried to write GreenScreen Shader file and I can cut off the green color.

    Next, I try to use the GreenScreen object to cast a shadow on ground, I found it hard to me.

    So many ShaderLab directive is undocument in Unity. I can't write only Vertex and Fragment Shaders to CAST a shadow in SM5.0. There is not Sample to use Vertex and Fragment Shaders implement SHADOW on Unity official document .

    Thanks.
     
  2. Jonny-Roy

    Jonny-Roy

    Joined:
    May 29, 2013
    Posts:
    666
    Yes you can, download the shader source files and dig through, it's not too hard to achieve what you want.
     
  3. nugao

    nugao

    Joined:
    Nov 17, 2011
    Posts:
    20
    Thanks for your reply.

    Yes, you are right.

    I find some shader about Shadow with Vertex and Fragment Shaders in Buildin Shaders.

    Thanks again.
     
    Jonny-Roy likes this.