1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice

Limiting range of light, sound etc. in games

Discussion in 'General Discussion' started by fufsgfen, Jul 22, 2018.

  1. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Usually limiting range is done by given radius from emitter, like for example cockpit sound environment is a sphere with radius that is around cockpit camera.

    I have found this quite limiting since late 90's early 00's

    There probably is very good reason why said sphere does not have X, Y and Z ranges, maybe that would be too expensive to computer?

    Also I wonder if other shapes would be feasible, like for example cone, instead of just radius, you get radius, rotation and angle to play with, certainly it would be fun for programmer to do such? :)

    Now there are lot of shapes, how wonderful it would be to be able to place cutoff plane in virtual space, say you have a emitter and that emits in cone like shape, like a spotlight, then you define a plane with direction range and rotation, said plane makes a cutoff, so you could get only half a cone emitted, how wonderful would be that?

    But in games it is always that single radius that makes a sphere, there probably is good reason for that, but I don't know what it is, as it does not appear to be very expensive to compute, or is it?

    Maybe it is more of being labor intensive to code?
     
  2. JZStudios

    JZStudios
    Expand Collapse

    Joined:
    Feb 23, 2016
    Messages:
    352
    Just in terms of audio, sound (and shockwaves) is a spherical pressure wave. Makes no sense to change individual XYZ dimensions.
    I don't know why you would need to make half a cone of influence, but it should be possible. Spotlight models and camera positions already exist, as well as audio... forget the words... cues? Playback based on camera position. UE4 has audio zones that you can block out with geometry and play different ambiances in and it'll transition between 2 zones.

    To reiterate, there's already games where sound changes once you enter a sphere of influence, even moving ones, so there's no reason it couldn't be whatever shape you want, but again I don't really know why you'd do that.

    More important is sound occlusion and reverb, for when there's a wall etc. between you and the audio source, or when your in a large empty room. These help sell the realism, and UE4 is doing a major audio engine overhaul to accommodate for this to allow multi-speaker setups and binaural audio just like the days of old.
    Dunno if Torque3D would be able to do any of that though.

    In terms of fun audio tidbits, Arma 3 takes into account the speed of sound and distance to source to cause delay from the visual, and effect the sound. Arma 3 also deals with very large distances, so you can see an explosion say 1km away, and after a second or two hear it in a muffled way. Probably does reverb too.



    Light really shouldn't much have limited range... The only limit for light is brightness (Light is also technically spherical, but can be focused into a beam.) But light is wavelengths and particles. After far enough away the light gets diffused and spread out enough to be less visible, but for most game engine draw distances it's too close to worry about really.

    But our visual acuity extends far beyond the horizon. If Earth were flat, or if you were standing atop a mountain surveying a larger-than-usual patch of the planet, you could perceive bright lights hundreds of miles distant. On a dark night, you could even see a candle flame flickering up to 30 mi. (48 km) away.
    Source: https://www.livescience.com/33895-human-eye.html

    If you're talking about shaping the light into half cones, already been there, done that for a LONG time.
     
  3. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    For example in BeamNG inside the car there are nodes, which emit sound, like blinkers, that have set radius, but cockpit of the car is not a sphere, it would be very beneficial to be able to set X, Y and Z ranges instead of just range.

    In game, we don't have liberty of realistic walls etc. so it makes much more sense to emit sound for example in cone shape to get effect of those walls, like engine bay etc. Far better than just using limiting range that would be sphere. Same for light.

    It is impossible to do real light calculations like headlight, currently games use simple spotlight that produces cone of light (instead of simulating reflections etc.), but headlights have a cutoff, they project light wider but not tall.
     
    • Like Like x 1
  4. JZStudios

    JZStudios
    Expand Collapse

    Joined:
    Feb 23, 2016
    Messages:
    352
    Well... unless your doing camera pans through the car the easiest solution for a blinker sound effect is to zone it to only play in cockpit mode. Otherwise like I mentioned UE4 does, just make a shape roughly cockpit shaped and have the sound play inside that shape. I can't remember exactly if you can set an audio source inside that shape, or if it's just a sort of "ambiance" thing with no real 3D positioning.

    Battlefield 4 underwent some audio changes and they started using some basic ray tracing from an audio source to the camera to see if/what/how many objects were between the source and camera and ran the sound through some filters. They could assign different filters/dampening values to certain objects/materials, so a brick wall would muffle sound more than a fence with a tarp on it for example.

    I think the way Forza (and other better racing games) do it is they record the car from the different angles, and when you pan around it does a smooth transition between the zones. For the cockpit they just record in the cockpit. I think the blinker might've been a bad example because you really only hear it from the cockpit unless your missing doors, and then probably only if your in the spot without a door.

    So I think Battlefields simple ray tracing, or UE4's newer audio engine (whenever it releases) also using ray tracing I believe is what your looking for.
    Battlefield mainly uses it for sound occlusion, otherwise they zone off audio effects (At least in BF3, 4 and Hardline) to being inside, outside, in a metal shipping container, etc...
    UE4 is going for physical, so you get real sound bounces to tell where the object is in 3D space, and it should naturally have more or less reverb n such. That thing that we had back in the early 2000's is finally coming back... maybe



    I'm not 100% sure how games like Forza do headlights. Some games just do simple spotlights, and I know that certain engines allow you to change the shape of the spotlight. Blender for example (pretty sure) added the ability to make elliptical and square/rectangular spotlights. Anything more fancy or custom than that I don't really see happening for most games since it's common to have hundreds if not thousands of lights. Making that many custom lights is ludicrous.

    What I do know is that some engines support this thing called IES profiles. If you don't know, IES profiles are basically a LUT for how a real life light bulb emits light in 3 dimensions. I'd assume this is how Forza does it, and it's easy enough to apply individual IES profiles to individual lights/cars which is why they don't all look the same. It's real, physically based, and contains all the 3 dimensional lighting, so it would be just as tall as real life. Headlights aren't really designed to be vertically tall.

    Here's a random video on IES that was basically the first Youtube result.
     
    • Informative Informative x 1
  5. JZStudios

    JZStudios
    Expand Collapse

    Joined:
    Feb 23, 2016
    Messages:
    352
    The Battlefield 4 ray tracing audio


    Unreal apparently doesn't have a new demo of their audio engine outside of their live streams, and I don't really want to scrub through hours of footage right now.
    Here's some little indie studio that made their own audio engine tweaks for binaural audio.

     
    • Informative Informative x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice