Home Technical Talk

parrallaxing / depth offset grass shader

monodrobe
polycounter lvl 9
Offline / Send Message
monodrobe polycounter lvl 9
I really like this shader for grass that they designed for act of aggression, Im trying to backwards engineer it. I feel close but missing some important elements. Or maybe Im way off

[media]https://youtu.be/5DF16_F8PiI[/media] 
[media]https://youtu.be/B6uVf7aHolc[/media]

so i ve played around with a basic noise texture as a height map using bump offset in ue4 and i can get the  vertical parrallax feel of the grass, but theirs has distinct caps to the grass which i can t figure out

but more critical is how theres interact with objects, take note of the rock. I suspect they re using something like pixel depth offset along with the vector of the camera. I havnt been able to reproduce the effect but I ve yet to try incorporating the camera vector into my shader yet

Love to hear opinions on how peeps think they did this and if its possible / how to go about it in ue4

thanks

Replies

  • kodde
    Options
    Offline / Send Message
    kodde polycounter lvl 19
    I can't help but to feel that the grass seems to give the appearance of being on a lower elevation level generally. There are some exceptions such as the rock which you mention. But when you look at the car wheels in video 1, or the tree in the middle of the grass in video 2, you get the feeling of disconnect. I.e. the car wheel and tree trunk seems to sit "on top" of the grass.

    But I think the tech is interesting. Also curious how this is done.
  • monodrobe
    Options
    Offline / Send Message
    monodrobe polycounter lvl 9
    theres the landscape layer and then the grass plane ontop of it. Its what i was trying to demonstrate in the vids. the plane floats and then they use some kinda parrallax technique to create the illusion its that deep, so the illusion doesnt work on the very edge of the plane
  • Eric Chadwick
  • monodrobe
    Options
    Offline / Send Message
    monodrobe polycounter lvl 9
    I suppose it could be a few layers, but it really looks like a single plane to me. The shell technique is similar to what the parrallax shader will do on its own if set up right
  • monodrobe
    Options
    Offline / Send Message
    monodrobe polycounter lvl 9
    played around with the shell concept a bit, major down fall of it is that mip maps murder it down to nothing as you zoom out.

    Additionally heres some notes I made that might help clarify what they got goin on

  • Eric Chadwick
    Options
    Offline / Send Message
    Yeah you need to bias the mips, just like with any other alpha tested map. Or you can use anisotropic filtering.
  • monodrobe
    Options
    Offline / Send Message
    monodrobe polycounter lvl 9
    ue has bi and tri filtering along with nearest for filtering, I tried out nearest initially cause i figured that would be the closest. Not familar with biasing  mips. Guessing that means changing the distance at which it should swap
  • Eric Chadwick
    Options
    Offline / Send Message
    It means hand-crafting the mips, or controlling the way the mips are created. Nvidia's photoshop plugin for making DDS files has some controls for biasing. It's a bit of trial-and-error to do though, and assumes you'll be using DDS container format.. Though you can extract the mips as individual bitmaps if you want, to recombine them into other formats if you want.
  • monodrobe
    Options
    Offline / Send Message
    monodrobe polycounter lvl 9
    found the bias , but not sure how to implement it, its set to 0 by default, 1 and up are the lower res ones, so tried -1 but couldnt really tell if it made a diff.

    I think my test dot texture was too small / fuzzy, so i switched to transparent and dithered. Like to keep it masked so I went with dithered and am getting better results. Its starting to shape up into an interesting shader  / model.

    I ll have to experiment later with more representative maps to see how it can hold up.

    given that, any suggestions on how to render out  depth slices? Say i modeled out a grass field usin tubes or something and then i d wanna grab 3 or 4 vertical slices from that. I guess I could litterally slice the model and render it out in pieces. Or maybe the min max hieght settings when rendering a projection map? These are my intial thoughts, any other ideas come to mind?
  • monodrobe
    Options
    Offline / Send Message
    monodrobe polycounter lvl 9
    ohh, so I could take the 3 mips and make em all the same, or just nuke all the fuzzy mips
  • Eric Chadwick
    Options
    Offline / Send Message
    Yep, you can do anything you want with the mip levels, if you can import/export into/out of Photoshop.

    I've rendered geometry into slices before, using 3ds Max, to make 3d volume textures. I used animated modifiers to Slice and fill the innards. ProBoolean also might be an option, depending on your models. 
  • Obscura
    Options
    Offline / Send Message
    Obscura grand marshal polycounter
    To make this in ue, you need to plug your parallaxed heightmap into the pixel depth offset input, with a multiplier on it... But unfortunately you'll get shadow errors if you use big multiplier.

Sign In or Register to comment.