Jump to content

havenphillip

Members
  • Posts

    550
  • Joined

  • Last visited

Posts posted by havenphillip

  1. I put together this depth buffer model shader but it doesn't work when I put post effects up. What causes this? How do I fix it/get around the problem? I assume there's a way around it because the depth part of the shader I got right from Josh's water shader. I think it must have something to do with the script, then...something I"m not doing right. Here's the script:

    function Script:Start()
        depthbuffer = Buffer:Create(context:GetWidth(),context:GetHeight(),0,1)
        depth = depthbuffer:GetDepthTexture()
        surface = self.entity:GetFace(0)
        mat = surface:GetMaterial()
        mat:SetBlendMode(Blend.Alpha)
        mat:SetTexture(depth,4)
    end

    function Script:UpdateWorld()
        depthbuffer:Enable()
        self.entity:Hide()
        world:Render()
        self.entity:Show()
        Context:SetCurrent(context)
    end

  2. Awesome .How is it so far? Exceeding expectations? The vibe I'm getting is that it'll be too complicated for someone like me and there won't be any help, so I won't be able to get anywhere with it. I just can't pay $700 for something like that. Looks like it's going to be amazing, though.

  3. That would be great if he did. Otherwise I wonder if all that work would be kind of obsolete by the time LE5 comes out. I'd get in the practice, though.

    I'm trying to make a list of shaders if you have any ideas.  I want to be reasonably sure I can do it before I commit to it. 52 shaders turns out to be a lot to think about lol. And  I don't want to just make goofy little shaders like "procedural checkerboard" or something. I want to make things people might actually use - stuff I would use.

  4. It's a cool effect. Thanks to Ma-Shell for posting it. I think the only collection of shaders currently is in the workshop. I'm thinking of starting a thread where I post a shader a week for a year, 52 shaders, then putting it in the workshop so there's a collection of shaders somewhere. I'm weighing it out. Just don't know if I'm good enough.

    I did develop this a bit if you're looking for a whole wet look:

     

    • Like 2
    • Thanks 1
  5. You can also go into any material shader under the "void main ()" and write " discard; " anywhere.  (and also disable "cast shadows" in the material editor then hit the save icon).

    void main()
    {
        discard;
    }

    • Like 2
  6. Well I deleted the player out of the scene and put him back in and it works fine now. Looks like the water plane has to be set up before the player is placed in the scene. Something to do with the camera order of operations or something I guess.

  7. I'm finally beginning to understand the depth projection in the Leadwerks water. I have a script set up to set the depth to a buffer (otherwise you have to turn on water mode, which I don't want to do) and it's almost working but it's shifting like crazy. When I walk around its fine but as soon as I move the camera it goes nuts. This doesn't happen with the LE water so what is different about the water mode that keeps that from happening? Is there a lua code behind the LE water somewhere or what? How do I get it to stop? Here's my code which I reduced down from an old Shadmar water

    function Script:Start()
        self.context=Context:GetCurrent()
        buffer2 = Buffer:Create(self.context:GetWidth(),self.context:GetHeight(),1,1,0)
        buffer = Buffer:GetCurrent()

        surface = self.entity:GetFace(0) --for brushes
        water = surface:GetMaterial()
        depth = buffer2:GetDepthTexture()
        water:SetTexture(depth,4)
    end

    function Script:UpdateWorld()
        buffer2:Enable();
        self.entity:Hide();
        world:Render()
        buffer:Enable()
        self.entity:Show();
    end

    .


     

    depthshift.jpg

  8. Easy to use. Fast. Good realism. Has reflection, refraction, and fresnel. Variables added at the top of the shader so you can easily adjust the water color, creek speed, creek direction, ripple size, refraction amount, and fresnel intensity. I desaturated the skybox reflection in the water, and there's a subtle plane displacement in the vertex to give a rising and falling effect along the shoreline.

    Notes:

    Put the skybox texture in slot 0 on the material

    Disable cast shadows on material

    Enable z-sort on material

    Make a box or plane and slap the material on it


     

    creek.jpg

    creek.zip

    • Like 7
  9. Here's a terrain model with a pixel depth offset shader with trails. I managed to figure out how to keep it from looking like things are slipping over the parallaxed surface so now you can put stuff on it. It's a little temperamental still. It doesn't like horizontal intersecting (shifts a bit. Not sure how to fix that) and  the effect deteriorates with distance (which I think I can fix). But I figured out that you can get this thing quite a bit faster by shrinking all the textures except the diffuse since the parallax effect and diffuse do most of the work on realism, and I got it working on smoothed lumpy surfaces such as hills, etc. You can make your own trail pattern with a texture and use whatever trail diffuse you want and adjust the size and blend and other things. I added a bunch of variables to the shader to fiddle with so you can highly customize it or just mess with it.

    Notes:
    Put the included material on the terrain model (6 textures. The texture order is rocky soil diffuse, rocky soil normal, rocky soil smooth, rocky soil height, trails, hardpack diffuse, hardpack normal).
    Disable "Cast Shadows" on the material.
    Make sure the model has physics. I use poly mesh.
    Put the model in the scene and set the scale to 12*12*12 (temperamental. This is the size for the model the shader is set to work with)
    Put stuff on it so you can see the pixel offset effect.



     

    pdo.jpg

    parallax_pixel_depth_offset.zip

    • Like 2
×
×
  • Create New...