Page 1 of 2 12 LastLast
Results 1 to 20 of 32
  1. #1
    Member martinsh's Avatar
    Join Date
    Oct 2006
    Location
    valence, france
    Posts
    761

    tweaked parallax mapping with silhouette clipping

    Hey guys,
    greatel did great job implementing steep parallax mapping to BGE.
    It picked my interest to look at other parallax techniques. I am also planning to implement relief mapping in near future..
    But first.. I noticed that old parallax mapping has a flaw called texture swim - when viewed from sharp angles - textures starts to distort.. swim around surface. I kinda fixed that, not sure if i did right, but at least it works.
    Also i messed around with UV and i came up with silhouette clipping - cheap technique, but effective.

    Screens:




    and a blend.

    parallax_silhouette.blend

    controls:
    Mouse/WASD - move/rotate camera
    left mouse button - move light along with camera

    edit: also done as part for Twilight22 project.
    have fun!
    Last edited by martinsh; 13-May-09 at 11:16.



  2. #2
    wow martinsh very nice as always.. keep up good work
    working flawlessly here (onboard nvidia 9400)

    looking forward to another parallax mapping techniques.. hoping for 'iterative' one

    (still can't believe all those goodies and optimalizations for BGE last weeks... guys I'm stunned, bravo)



  3. #3
    Member
    Join Date
    Aug 2006
    Posts
    2,010
    I get
    Fragment Shader failed to compile with the following errors:
    ERROR: 0:25: '+' : wrong operand types no operation '+' exists that take a left-hand operand of type 'undefined interpolation 2-component vector of float' and a right-hand operand of type '3-component vector of float' <or there is no acceptable conversion>
    Then it repeats it with 0:30, 0:35 and 0:40...



  4. #4
    Member Mr. Smith's Avatar
    Join Date
    Sep 2008
    Location
    Belgium
    Posts
    67
    This is some magnificent work!
    I think this is the best parallax shader I've ever seen for Blender.
    Current project - The Lost Coast - Click me



  5. #5
    Member John_tgh's Avatar
    Join Date
    Dec 2008
    Location
    New Atlantis
    Posts
    477
    You bonnovasitch XD :P First picture left corner, it even renders it as if it intersects with a high poly model... XD How is it performance wise?



  6. #6
    Member Social's Avatar
    Join Date
    Nov 2005
    Location
    New Jersey, USA
    Posts
    3,596
    Thanks, this is good reference, and not to mention pretty. Also, thanks for hosting the .blend here, on the forums (makes the downloads easier).

    Now, show me a big scene, with real-time global illumination.

    PS: You should really try this in 2.49; there are several deprecation warnings.
    It is in the nature of powerless people to vicariously enjoy the exercise of arbitrary power by others.

    - Dmitry Orlov



  7. #7
    Member Ace Dragon's Avatar
    Join Date
    Feb 2006
    Location
    Wichita Kansas (USA)
    Posts
    20,705
    Is this really happening, the BGE actually surpasses Blender's own Internal Renderer on something!?

    If this is to be hardcoded, it should not only be for the BGE, but for the Internal Renderer as well, would be a useful trick for Durian.
    Sweet Dragon dreams, lovely Dragon kisses, gorgeous Dragon hugs. How sweet would life be to romp with Dragons, teasing you with their fire and you being in their games, perhaps they can even turn you into one as well.
    Need Cycles materials / node setups: Get them here



  8. #8
    Cooooool. I'll have to take a look at the coding and learn the master



  9. #9
    Member Ace Dragon's Avatar
    Join Date
    Feb 2006
    Location
    Wichita Kansas (USA)
    Posts
    20,705
    I tested it with various textures and I found an excellent reason why this needs to be hardcoded, you need programming knowledge to change its intensity and you can't scale the texture in the material settings.

    This will be used a lot more if it can be hardcoded into Blender so it's very accessable to artists who don't have the time to mess with GLSL code.
    Sweet Dragon dreams, lovely Dragon kisses, gorgeous Dragon hugs. How sweet would life be to romp with Dragons, teasing you with their fire and you being in their games, perhaps they can even turn you into one as well.
    Need Cycles materials / node setups: Get them here



  10. #10
    Very nice work! But yeah, from a novice point of view, hard coded would be nice and easy(er).



  11. #11
    Martinsh,
    les contours des briques en relief c'est fabuleux, l'image est littéralement extrudée de sa face, un pur régal!
    - - -
    Martinsh,
    the contours of brick relief is fabulous, the picture is literally extruded its face, a pure delight!



  12. #12
    Member blendmaster1024's Avatar
    Join Date
    Feb 2009
    Location
    Salt Lake County, Utah, USA
    Posts
    468
    to ops: i know i'm resurrecting an old thread, so shut up.

    martinsh: that looks OK, but it's not parallax occlusion. i found someone else's parallax occlusion at http://blenderartists.org/forum/showthread.php?t=156019, however it runs slower than i expected (not sure if this can be avoided or not) and it falls apart at the edges too, just now it's along the view xy plane, not the UV. i made my own texture to test it, and boy it's bad at the edges. you know why this might be?

    http://www.pasteall.org/blend/2685

    also, i could use a little help adding silhouette clipping to that shader.
    WHAT ARE YOU DOING READING MY SIGNIATURE!?



  13. #13
    Member leonnn's Avatar
    Join Date
    Dec 2008
    Location
    Brazil - PR - Maringá
    Posts
    2,510
    Be carefull with this parallax mapping, i try to open the file and when i pressed P, puf, the screen got black and after some seconds my windows informed me that my video card crashed!
    Not the martinsh one the linked one by blendmaster.



  14. #14
    Member blendmaster1024's Avatar
    Join Date
    Feb 2009
    Location
    Salt Lake County, Utah, USA
    Posts
    468
    that's not the shader's fault, that's your graphics driver's fault. i'll bet you're on an intel graphics card, aren't you?
    WHAT ARE YOU DOING READING MY SIGNIATURE!?



  15. #15
    Member polyman's Avatar
    Join Date
    Apr 2009
    Location
    CYBERSPACE- Local Sector Alpha Blender
    Posts
    239
    It doesn't work on my ATI card. It runs OK ,the planes stay textured and normal-mapped, but no effect occurs. Oddly enough, your earlier "relief map" file did. I wonder what the difference was.

    P.S. This Twilight22 is really going to be something, isn't it?
    <<Great job, Asteracers Team!>>



  16. #16
    Member blendmaster1024's Avatar
    Join Date
    Feb 2009
    Location
    Salt Lake County, Utah, USA
    Posts
    468
    pretty sure twilight 22 was called off. and I'm pretty sure martinsh still hasn't looked at this thread.
    WHAT ARE YOU DOING READING MY SIGNIATURE!?



  17. #17
    Member martinsh's Avatar
    Join Date
    Oct 2006
    Location
    valence, france
    Posts
    761
    Hey!
    That parallax shader worked for me like 2 seconds and then crashed my GPU driver.
    well from what I saw in these 2 seconds, it looked OK.
    I see what I can do with the shader to make it work properly and faster.

    Also the shader in first post is parallax mapping not parallax occlusion mapping. Both are very different in terms of technique.



  18. #18
    Member blendmaster1024's Avatar
    Join Date
    Feb 2009
    Location
    Salt Lake County, Utah, USA
    Posts
    468
    i am aware they are different in implementation, but they're fairly similar in what they do. the only thing that differs in a parallax occlusion from straight parallax is that occlusion deletes pixels that are out of view, instead of just squishing them.

    and seriously? your gpu driver crashed? i hope only blender was affected :/

    seems that i did something wrong...
    WHAT ARE YOU DOING READING MY SIGNIATURE!?



  19. #19
    Member martinsh's Avatar
    Join Date
    Oct 2006
    Location
    valence, france
    Posts
    761
    parallax occlusion mapping = relief mapping
    and I did relief mapping a while ago.

    GPU driver crashes pretty often for me as I experiment with shaders quite alot and it affects the whole PC, reboot is the only way to recover .

    Anyway: here is "Curved Relief Mapping" shader.
    http://fabio.policarpo.nom.br/docs/C...iefMapping.pdf

    screenshots:





    http://www.pasteall.org/blend/2695

    buttons 1 and 2 changes mesh from Sphere to Cylinder
    Last edited by martinsh; 13-May-10 at 20:36.



  20. #20
    Member Cloud_GL's Avatar
    Join Date
    Sep 2007
    Location
    Viña del Mar, Chile
    Posts
    1,028
    Lol you forgot to pack the images.
    Also 3 errors in command line:
    In Fragment shader lines 23, 91 and 111 there is an int to float cast issue, but can't find them, the line counter doensn't work properly on C shaders =___=.



Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •