Search Unity

Fabio Policarpo - Relief Mapping with Correct Silhouettes

Discussion in 'Shaders' started by apple_motion, Oct 20, 2009.

  1. kim0

    kim0

    Joined:
    Dec 25, 2010
    Posts:
    17
    Hi all,
    I am impressed and I have some questions to ask on the shader
    I tested the texture_863.zip with relaxed_cone_relief_mapping_112.shader but do not see the shadows effect.
    if I put a light in the scene does not reflect over the object and the shadows do not appear.
    See example:



    There is a method to see shadows?
    Is possible to react to light the scene the object created with this shader?
    I'd like to use this shader, but it does not react to the external lights of the stage and if it does not create shadows remains an unusable product.
    Could someone help me understand?
     
    Last edited: Dec 31, 2010
  2. kim0

    kim0

    Joined:
    Dec 25, 2010
    Posts:
    17
    nobody help me? :(:(
     
  3. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    Those shaders are written that way. Light doesnt effect them... someone would have to modify them for you in order to react with lights in the scene.
     
  4. glra2222

    glra2222

    Joined:
    Jan 24, 2011
    Posts:
    2
    How do you get the silhouette working? I've got an image similar to his first image, except that mine doesn't have the bumpy edges.
     
  5. kim0

    kim0

    Joined:
    Dec 25, 2010
    Posts:
    17
    Welcome on page of non-responses with me!
     
  6. Frank Oz

    Frank Oz

    Joined:
    Oct 13, 2010
    Posts:
    1,560
    Finally got around to taking a look at the updated one. No go on 3.2 or I imagine 3.3, fails to compile on both Pro and Indie, PC and Mac :(
     
  7. reissgrant

    reissgrant

    Joined:
    Aug 20, 2009
    Posts:
    726
    Yes, 3.3 is giving me some odd errors with a lot of my shaders. I'll look at it when I get some time.
     
  8. reissgrant

    reissgrant

    Joined:
    Aug 20, 2009
    Posts:
    726
  9. Frank Oz

    Frank Oz

    Joined:
    Oct 13, 2010
    Posts:
    1,560
    YAY! *runs off to try it*

    Oh wow that looks awesome! :O Those guys further up the thread are gonna die if they don't spot this thread now, lol. Awesome work man, awesome indeed! :D

    Works fine with shadows, lightmaps, the lot, more awesome haha.


    A weird thing happened though, when I first imported it and tried it, half of anything it was used on would appear invisible. I fiddled with it, trying to get it working right, had some success but then gave up as I don't know what I'm doing and reverted back to the original version, and suddenly it works perfectly fine. Weird, lol.

    Edit: Ignore that last bit about the weird thing, the problem was between the chair and the computer. Just realized it only does it if you change the texture to anything other than x1, y1. My bad!
     
    Last edited: Mar 8, 2011
  10. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    It has got some problems yet IMHO.
    Also, quite useless without shadows implemented.
     
    Last edited: Mar 11, 2011
  11. Katori

    Katori

    Joined:
    Nov 30, 2009
    Posts:
    60
    This shader is great, truly proper amazing. But it's not silhouette-correct like the others, is it?

    Thanks for making this.
     
  12. slgooding

    slgooding

    Joined:
    Jan 12, 2009
    Posts:
    112
    Would it be possible to add a fresnel effect to this shader?
     
  13. reissgrant

    reissgrant

    Joined:
    Aug 20, 2009
    Posts:
    726
    Possible? Sure, but keep in mind they still cannot be modified to work with Unity's shadow system.
     
  14. slgooding

    slgooding

    Joined:
    Jan 12, 2009
    Posts:
    112
    Good to know. Now I just wish I had the knowledge to do it. I'm working with cellular models and I don't want shadows, so a solution with fresnel would be awesome.

    BTW, I don't know if I mentioned it, but I found that the xNormal relief map works pretty well and computes much faster than the preprocess executable.
     
  15. Daniel_Brauer

    Daniel_Brauer

    Unity Technologies

    Joined:
    Aug 11, 2006
    Posts:
    3,355
    Why is this?
     
  16. reissgrant

    reissgrant

    Joined:
    Aug 20, 2009
    Posts:
    726
    You would have to modify the depth map before Unity processes it, to include the new silhouettes from the relief mapped objects. Of course, I could write a custom shadow solution to output my own depth map, but really would be great if we could tie it into Unity's.
    If you know a way to access the depth buffer before it's processed for shadows, please let me know and I will happily stand corrected!
     
  17. Hao-Cher-Hong

    Hao-Cher-Hong

    Joined:
    Dec 15, 2010
    Posts:
    127
    $擷取.PNG
    why is this??
     
  18. Chickenlord

    Chickenlord

    Joined:
    May 13, 2011
    Posts:
    381
    Its a common issue. You set the alpha to 1, if the calculated uv's are not in the 0 - 1 range. As far as i know, theres no easy way to change it.
     
  19. Hao-Cher-Hong

    Hao-Cher-Hong

    Joined:
    Dec 15, 2010
    Posts:
    127
    what do you mean?
    so how can I fix it,and what caused this problem?
    :confused:
     
    Last edited: Jul 24, 2011
  20. Chickenlord

    Chickenlord

    Joined:
    May 13, 2011
    Posts:
    381
    Thats the point, you can't fix it. Simply don't use alpha, to avoid it.
     
  21. Hao-Cher-Hong

    Hao-Cher-Hong

    Joined:
    Dec 15, 2010
    Posts:
    127
    thanks a lot,
    its solved. :D
     
  22. killme

    killme

    Joined:
    Jul 25, 2011
    Posts:
    3
    Thank you Reissgrant for your conversion. I'm trying to get the first post result with it but I dont succeed. There is no occlusion. The result is like a parallax mapping and not a relief mapping. Could you help me.
     
  23. Azazeo

    Azazeo

    Joined:
    Oct 12, 2011
    Posts:
    23
  24. napalmdev

    napalmdev

    Joined:
    Nov 19, 2011
    Posts:
    1
    Anyone have the project FXComposer and depth textures used in the Relief Mapping of Non-Height-Field Surface Details? The author's link is broken for sources and I do not know how to generate those textures, rings depths or the dog depths represented in the paper.

    Thanks
     
    Last edited: Nov 20, 2011
  25. slgooding

    slgooding

    Joined:
    Jan 12, 2009
    Posts:
    112
    Does this shader actually work with silhouettes? It doesn't look like it to me... just wondering if I'm doing something wrong with the textures...
     
  26. reissgrant

    reissgrant

    Joined:
    Aug 20, 2009
    Posts:
    726
    The shader does not work with silhouettes, as you need to modify the depth map for that and it's currently not possible, from what I understand.
     
  27. trentdk

    trentdk

    Joined:
    Jul 28, 2011
    Posts:
    22
    Reissgrant; I love this shader. As Frank Oz alluded to earlier, it doesn't appear that the textures can be tiled. Is that an inherent impossibility, or could that be programmed into the shader?

    Edit: NEVERMIND -- I just found the "tile factor" slider.
     
    Last edited: Mar 7, 2012
  28. rezilausiv

    rezilausiv

    Joined:
    Nov 18, 2010
    Posts:
    126
    Hi

    The shader "relief_correct_silhouettes_181.shader" is producing errors in Unity 3.5.2.
    Is it our maloperation, or a known problem?
    We put the shader within a folder named "shader" into the asset folder.

    Thanks for a short feedback
     
  29. pinkhair

    pinkhair

    Joined:
    Dec 17, 2010
    Posts:
    141
    So what is the best practice for laying out UVs for this sort of shader to avoid problems?
     
  30. mike pool

    mike pool

    Joined:
    Nov 29, 2012
    Posts:
    3
    can you share the shader in unity 3.5 or hight?