Search Unity

New to manipulating shaders in Unity and need some guidance

Discussion in 'Shaders' started by CaitL, Nov 14, 2018.

  1. CaitL

    CaitL

    Joined:
    Sep 14, 2018
    Posts:
    7
    I am working on an independent project for one of my classes in which I need to morph textures using WebGl, and through manipulating the data sent to the shaders. For this class (Computer Graphics) we have mainly been writing out JavaScript and HTML files just in Notepad++, but since this is an extra honors college project, my professor wants me to try to use Unity. The problem is, I don't really understand how to do this. I have looked at the tutorials that Unity has made available (https://docs.unity3d.com/Manual/ShaderTut2.html and https://docs.unity3d.com/Manual/SL-VertexFragmentShaderExamples.html), but I don't exactly understand how to actually use it in Unity itself. I kind of understand how to manipulate the shaders, but not how to tie in the elements wanted from unity.
    For my project, I am trying to make a flat panel that covers the screen. On this will be a texture image of a landscape. On top of the landscape image (imported as a .jpg), I am going to be laying a texture of raindrops (imported as a .png with a transparent background). The shaders are then going to be used to morph this raindrop texture and move the raindrops down the panel (basically by moving the texture coordinates down and wrapping around once it reaches the bottom of the panel-- think like a conveyor belt).
    I don't know how to write these textures to the shaders for manipulation.
    Can anyone either give me some advice on how to do this or point me towards some good sources? I looked for them, but I couldn't find many that were actually helpful.
    Thanks!
    (Also if anyone knows anything about mapping normals to a texture brought in as a .png, I could also use some help with that subject, as my professor said that randomly skewing the normals by a tiny margin from time to time would make the effect more realistic).