Nox had a very nice feature: dynamic view cones! When the player moved, they were updated in real time. What an eye catcher!
The indie game Teleglitch also has this feature. “Awesome Simon, thank you for pointing this out. Next!”. Not so fast, little Padawan! I mention this, because they fake the view cones in a very interesting way! At first I also thought “Oh ok, they have this Nox-Effect nice.” but after a while i noticed, that they move a bit differently. And then i saw how it works.
No I didn’t! Twice. I was corrected via mail and also now via a comment from johann and i have no idea why i didn’t updated the article… but better later then never, right? *correct mode on*
The code extrudes black “walls” above some objects and the walls upwards to the camera. Simple but awesome. But they don’t let the black walls start directly at the top of the objects. There’s a small gap in between so you can still see the top areas of the objects/walls. I love it.
Here’s the quote of the mail i got:
Actually, the line of sight shadows aren’t done with perspective. They are just black polygons extruded from the walls away from the player. The math is similar to black 3d walls extruding towards the camera, but if you really look at them, they aren’t.
Since my originally thoughts are at least similar to the actual technique, i think i can let the following stay in the article:
Because i have no idea about math and coding, and it’s hard for me to imagine things which i can’t see. So i checked the difference of “real” view cones vs. extruded walls (which isn’t what they actualy did, but at least it’s similar). What i saw was, that the columns aren’t 100% correct, but definitely good enough. Have a look Mr. Bond:
I can only speak for myself but this impressed me a lot. This is a great idea to save the time which would be necessary to code “real” view cones. Oh and if you’re a coder and interested, one of the developers sent me a link to the code.
Source: Viewcones by Eric Tahiri