Volume Decals demo

Discussion in 'Rendering Technology and APIs' started by Humus, Oct 4, 2009.

  1. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    I haven't published a demo since February, man it's been way too long, but now it's time again! Woot! :)
    This one is a little more interactive too since you paint the decals yourself. It's hours of fun! :p

    [​IMG]

    The demo illustrates a technique for decals seamlessly wrapping around arbitrary geometry by rendering decals as convex volumes. The technique will be featured in the upcoming book GPU Pro - Advanced Rendering Techniques.

    The demo is available for download here:
    http://www.humus.name/
     
  2. Voxilla

    Regular

    Joined:
    Jun 23, 2007
    Messages:
    737
    Likes Received:
    310
    Pretty cool demo.
    I was wondering if it works on translucent geometry, because you probably normally would not render a Z buffer in that case.
    Also for fully transparent mapped patterns like fences or leaves I wonder what would be the result, probably it could work I guess if no Z is written for the transparent regions.
     
  3. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    It'll work fine for alpha tested stuff, as well as alpha-to-coverage. For alpha blended stuff it's a bit trickier. You wouldn't get any decals on the transparent stuff. The technique is best suited for deferred renderers anyway, and they have a problem with alpha blending anyway. But if you'd use a "deep deferred renderer" though it would integrate just fine.
     
  4. alt_nick

    Newcomer

    Joined:
    May 27, 2006
    Messages:
    75
    Likes Received:
    2
    Location:
    Tampere, Finland
    Camera movement is glitched on my machine.
    Seems like the movement vector is inverted every n steps causing a back and forward movement (slightly skewed forward).
    Happens in all directions and regardless of framerate or if I tap or hold the key. Might be due to a too large collision detection object, but I can't confirm.
     
  5. digitalwanderer

    digitalwanderer Dangerously Mirthful
    Legend

    Joined:
    Feb 19, 2002
    Messages:
    17,577
    Likes Received:
    2,020
    Location:
    Winfield, IN USA
    Could you whip up a couple of cool DX11 demos for me real quick Humus?

    Kthnxby.
     
  6. Voxilla

    Regular

    Joined:
    Jun 23, 2007
    Messages:
    737
    Likes Received:
    310
    Another 'issue' with the technique is that it paints on the backside of objects that are thinner than the paint volume. Like splatting on the corner of walls when only one wall is visible there is also paint on the other side. The same happens when painting on bottom of the hanging lights, also the top side is painted. It seems an artifact inherent to the technique that may not be easy to solve, maybe by clipping the paint volume.
     
  7. Davros

    Legend

    Joined:
    Jun 7, 2004
    Messages:
    15,718
    Likes Received:
    2,858
    You sod off, I'm still waiting for my fireworks screensaver
     
  8. Simon F

    Simon F Tea maker
    Moderator Veteran

    Joined:
    Feb 8, 2002
    Messages:
    4,560
    Likes Received:
    157
    Location:
    In the Island of Sodor, where the steam trains lie
    There will be a one day ban issued for any further mentions of that &%%^ screensaver.:twisted:
     
  9. Captain Chickenpants

    Regular

    Joined:
    Feb 6, 2002
    Messages:
    446
    Likes Received:
    14
    Location:
    Kings Langley
    I still miss the CyberK screen saver I had with my Apocolypse 3dx.

    CC
     
  10. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    What CPU & GPU?
    If you start the demo, open task manager, right click the process and set affinity to CPU0 only, does the problem go away?

    I'll get to that once I have a DX11 card.

    Depending on what you're using the decals for it may indeed not be desirable to paint back faces, for instance paint/blood splashes. Burn marks from fires on the other hand looks best if it burns everything within the volume. I elaborate on solutions to this problem in the article. I haven't implemented any techniques for it in the sample though, but it's not too hard to solve. A quick and dirty solution is to look up the normal and simply not apply it to backfaces, which is not 100% perfect in all cases though but solves simple cases like over corners. For a complete visibility check from the point of the blast you can use a "blast shadow map".
     
  11. Davros

    Legend

    Joined:
    Jun 7, 2004
    Messages:
    15,718
    Likes Received:
    2,858
    Damm looks like i'll have to go back to harassing RolfN to update his glide wrapper
     
  12. alt_nick

    Newcomer

    Joined:
    May 27, 2006
    Messages:
    75
    Likes Received:
    2
    Location:
    Tampere, Finland
    Q6600 and 8800GTS640. Windows 7 final RC, so might be a beta software issue.
    Setting affinity didn't help.
    Video
     
  13. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    I used to see similar jumpiness in my older demos when I first got a dual-core CPU. It was a simple effect of timers not being in sync across the CPUs, so every time the process was scheduled on the other core the delta time could be negative, and then shoot forward again. I sorted that issue out in the framework a long time ago though so it really shouldn't happen anymore. Your issue looks slightly different though, the movement back and forth looks smoother than it used to look for me, as if time is progressing by sin(time) or something. Weird.
     
  14. Richard

    Richard Mord's imaginary friend
    Veteran

    Joined:
    Jan 22, 2004
    Messages:
    3,508
    Likes Received:
    40
    Location:
    PT, EU
    Excuses, excuses. Did Einstein ever say "..but I don't have a time machine"? :razz:

    I guess I'll have to wait for the paper, but is the process anywhere along the lines:

    1. Trace obstacle
    2. Generate omnidirectional light g unit between view point and impact point
    3. Render 5 face cubemap as shadowmap
    4. Colour shadow map onto world geom

    ?
     
  15. Thowllly

    Regular

    Joined:
    Feb 6, 2002
    Messages:
    551
    Likes Received:
    4
    Location:
    Norway
    I got the exact same effect in the Deferred shading 2 demo. My HW is different, Phenom 3x and Radeon 4850, but I run Windows 7 final RC too, so I think you're right it might be a beta issue.
     
  16. Andrew Lauritzen

    Moderator Veteran

    Joined:
    May 21, 2004
    Messages:
    2,526
    Likes Received:
    454
    Location:
    British Columbia, Canada
    Nice! Runs great here all around!
     
  17. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    Not sure I understand what you mean in (2), or why 5 of the cubemap faces would be sufficient. I'd replace 2 & 3 with "render shadow map from impact point", and express 4 somewhat differently perhaps, but yeah, sort of like that.
     
  18. assen

    Veteran

    Joined:
    May 21, 2003
    Messages:
    1,377
    Likes Received:
    19
    Location:
    Skirts of Vitosha
    Great, we were thinking of doing something like that.

    One minor problem is that you should render these before rendering the "dynamic" objects, to avoid e.g. the foot of a character being affected by the decal.
     
  19. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    Yep. That's another topic I cover in the article. :)
     
  20. Richard

    Richard Mord's imaginary friend
    Veteran

    Joined:
    Jan 22, 2004
    Messages:
    3,508
    Likes Received:
    40
    Location:
    PT, EU
    Thanks Humus. Yep, I was going to ask about that (whether you somehow stored into a lightmap or kept it real-time but avoided moving objects).

    Btw, I was saying only 5 faces in case you rendered the shadow cubemap orthogonal to the traceline since the 6th surface facing towards the eyeview wouldn't ever be needed. Speaking of which, aren't 3 faces all that are needed? If you render the cubemap at a 45ยบ angle on all axis so that the common vertex of the three faces of the cube is exactly on the trace line? Maybe there's some corner cases I'm neglecting though.
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...