Home Technical Talk

Fake volumetric light

polycounter lvl 9
Offline / Send Message
VPrime polycounter lvl 9
Hey guys, I am trying to make a fake volumetric light effect (for a flash light) tow ork with an iPhone game..
I can't figure out a good way to go about this.

I tried to make 2 planes and have them cross like this:
     |
  -------
     |


But that doesn't look to great... I can clearly see the crossing in game.
here is a screenshot of how it looks ingame..
Screenshot2010-07-20at15044AM.png

Does any one have any ideas on how I could create a nice looking fake volumetric light?

Replies

  • mortalhuman
    Do, like, a cone shaped cylinder, then delete the end faces or map those with your transparent part of your image, and once you map the cylinder part you can work with that to get what you need (probably best to fade the intensity as it goes out as to not see any borders at the end).

    Basically, model the volume of the light in the cone that represents it. Hope I've helped.
  • Chai
    Offline / Send Message
    Chai polycounter lvl 18
    Well mortalhuman pretty much summarized the standard approach to it.

    I was doing some reading into this very subject, and came across an interesting link .. I'd recommend checking it out as it's a nice detailed and visual explanation of this approach (in UDK) :
    http://udn.epicgames.com/Three/VolumetricLightbeamTutorial.html

    Edit: I also remember the two plane approach from many years ago, not as good as the cone one ... but if you wanna make it work - you have to make sure there's no shading on it, or it will give away the two planes. (try self illuminated, with alpha)
  • VPrime
    Offline / Send Message
    VPrime polycounter lvl 9
    Ah thanks! Yeah I was doing the 2 plane thing from something I have seen many many years ago (quake 2 days I think?)

    Cone method/the link is great thanks!
  • Carl Brannstrom
    You could also use several planes that always facing the camera, almost like a particle effect.
    Might not have the optimal fillrate though...

    volumee.jpg
  • Tumerboy
    Offline / Send Message
    Tumerboy polycounter lvl 17
    Chai that's a good read. Don't suppose you have bigger versions of those Node layout shots eh? I can barely make out what anything is. . . :/
  • Neox
    Offline / Send Message
    Neox godlike master sticky
    corv wrote: »
    You could also use several planes that always facing the camera, almost like a particle effect.
    Might not have the optimal fillrate though...

    have fun with the sorting :D
  • haiddasalami
    Offline / Send Message
    haiddasalami polycounter lvl 14
    Tumerboy wrote: »
    Chai that's a good read. Don't suppose you have bigger versions of those Node layout shots eh? I can barely make out what anything is. . . :/

    If you follow the tutorial you should get something like that. Personally I have never been able to re-create that one but I used it as a building point to get what I wanted. Will send you pics or just send you the map file (pretty sure I saved it there)
  • Tumerboy
    Offline / Send Message
    Tumerboy polycounter lvl 17
    Nah, not working in UE, trying to replicate the process in our engine. We currently have the shitty type of light beams that have hard edges etc. So I'm trying to correlate what UE calls something to what our engine does, and the tiny text for each box in the material set up doesn't help me.
  • THE 5
    Offline / Send Message
    THE 5 polycounter lvl 14
    /industry outsider input
    Why not just use 1 plane facing the camera?
    The cone gives a better result when intersecting other geometry though.
  • Tumerboy
    Offline / Send Message
    Tumerboy polycounter lvl 17
    because 1 plane facing the camera isn't 'volumetric' The whole point is to take up space, so that when viewed from different angles (heights, etc.) it looks like the light has shape and volume to it.
  • cman2k
    Offline / Send Message
    cman2k polycounter lvl 17
    Ohhh, nice UDK link. I've looked at these sorts of things before but never truly understood how the effect was achieved...only parts of it. It's an interesting series of techniques and I love that it's all in one shader, no fancy in-engine tricks.

    Nick we need to steal this shit, like yesterday.
  • Eric Chadwick
    Since you're on the iPhone, check out if you have vertex alpha support, it'll give a smoother fadeout along the cone than a texture would (and use less mem).

    Beware though it'll probably cause sorting probs with anything else that's transparent in the world. iPhone's not much in the hardware dept.
  • Chai
    Offline / Send Message
    Chai polycounter lvl 18
    Tumerboy I'm afraid not .. I'd just use it as a guideline rather than a step by step guide.
  • Tumerboy
    Offline / Send Message
    Tumerboy polycounter lvl 17
    Ya, that's pretty much what we're doing. The text doesn't cover some of the stuff I can see he's doing in the material layout though, and I can't figure out what is actually going on in there, i.e. he's doing a bunch of clamping on the blue channel, and then dividing the red channel by the square root of the blue channel???
  • arrangemonk
    Offline / Send Message
    arrangemonk polycounter lvl 17
    blob cone + falloff as alpha - %of non vidibility and youre in
Sign In or Register to comment.