POV-Ray : Newsgroups : povray.off-topic : RK4 is harder than it seems Server Time
7 Sep 2024 09:25:35 EDT (-0400)
  RK4 is harder than it seems (Message 15 to 24 of 24)  
<<< Previous 10 Messages Goto Initial 10 Messages
From: Warp
Subject: Re: RK4 is harder than it seems
Date: 1 Aug 2008 17:10:42
Message: <48937bd2@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> >> I also assumed that scenery is always static in games so that you can 
> >> precompute light maps
> > 
> >   Actually nowadays games tend to use less and less precomputed light maps
> > and more real-time lighting.

> How is it possible to do that?

> (I'm not denying that games do it - they obviously do - I'm curios as to 
> how it's possible to do this given that the GPU only knows about 
> polygons and texture mapping.)

  The GPU also knows about vertex normals and can interpolate them and
calculate the lighting of the surface according to the normal. In a similar
way as POV-Ray does.

  Nowadays you can even write a shader which calculates the lighting from
the normal vector and positions of light sources in special ways, if you
want.

-- 
                                                          - Warp


Post a reply to this message

From: John VanSickle
Subject: Re: RK4 is harder than it seems
Date: 1 Aug 2008 23:25:19
Message: <4893d39f@news.povray.org>
Warp wrote:
> triple_r <nomail@nomail> wrote:
>> In all fairness, there are better methods.  Think of dividing all the particles
>> up into an octree.  A whole group of particles at a distance can be lumped into
>> one mass.
> 
>   But you have to calculate the center of mass of the whole group, and
> since each element of the group can change independently of the others,
> that would mean you have to re-calculate this center of mass each time
> anything changes.
> 
>   Also another problem is that groups don't stay the same. If a particle
> not belonging to the group enters the "inside" of the group, it cannot
> be calculated anymore against that group as if it was just one single
> mass located at the center of mass of the group.

The point that accuracy requires the O(n^2) solution was rather blithely 
ignored, too.

If the forces involved follow the 1/(d^2) rule (such strange forces as, 
oh, gravity), then the non-linearity causes the averaging to yield a 
different total force than the sum of the forces exerted by the 
different masses.  For instance, if particle A is at distance x_a 
(relative to the affected point), and particle B is at distance x_b 
(likewise relative), then using an average yields a force of:

   2/(x_a/2 + x_b/2)^2, whereas the actual force is

   1/(x_a^2) + 1/(x_b^2) = (x_b*x_b)+(x_a*x_a))/(x_a^2 * x_b^2)

If x_a = 1 and x_b = 1.01, then the forces are:

   2/( 1.005^2) = 2/1.010025 = 1.9801490062127175069924011781887

whereas the other sum is

   2.0201/1.0201 =             1.9802960494069208901088128614842

and this is an application where an error of this magnitude most 
certainly does make a difference.

Unless you just want to make pretty pictures.

Regards,
John


Post a reply to this message

From: Invisible
Subject: Re: RK4 is harder than it seems
Date: 4 Aug 2008 04:06:01
Message: <4896b869@news.povray.org>
>> How is it possible to do that?
> 
>> (I'm not denying that games do it - they obviously do - I'm curios as to 
>> how it's possible to do this given that the GPU only knows about 
>> polygons and texture mapping.)
> 
>   The GPU also knows about vertex normals and can interpolate them and
> calculate the lighting of the surface according to the normal. In a similar
> way as POV-Ray does.
> 
>   Nowadays you can even write a shader which calculates the lighting from
> the normal vector and positions of light sources in special ways, if you
> want.

I was more puzzled as to how you compute shadows.

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Warp
Subject: Re: RK4 is harder than it seems
Date: 4 Aug 2008 09:39:11
Message: <4897067e@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> I was more puzzled as to how you compute shadows.

  That's actually one of the limitation of lightmaps: You can create superb
shadows for *static* scenery, but you can't use them to calculate shadows
for moving objects. This ends up in the situation with most older 3D games
(and many of the modern ones as well) where you have great-looking shadows
for everything except moving objects.

  There are two techniques to calculate shadows: Shadow volumes, which are
based on shadow polygons (used, for example, by Doom3 and games using the
same engine) and shadow mapping (used, for example, in the Splinter Cell
games).

  Both have their advantages and disadvantages, which is why neither one
is overwhelmingly popular (although shadow mapping might be a bit more
popular because it's a bit easier to implement and has its own advantages).

http://en.wikipedia.org/wiki/Shadow_volume
http://en.wikipedia.org/wiki/Shadow_mapping

-- 
                                                          - Warp


Post a reply to this message

From: Invisible
Subject: Re: RK4 is harder than it seems
Date: 4 Aug 2008 10:21:08
Message: <48971054$1@news.povray.org>
Warp wrote:

>   That's actually one of the limitation of lightmaps: You can create superb
> shadows for *static* scenery, but you can't use them to calculate shadows
> for moving objects.

Yep, it's true.

(Well, if you have an "almost" static scene, you could perhaps include 
extra data for, say, when a door opens or something. I doubt it would be 
very accurate.)

>   There are two techniques to calculate shadows: Shadow volumes, which are
> based on shadow polygons (used, for example, by Doom3 and games using the
> same engine) and shadow mapping (used, for example, in the Splinter Cell
> games).
> 
>   Both have their advantages and disadvantages, which is why neither one
> is overwhelmingly popular (although shadow mapping might be a bit more
> popular because it's a bit easier to implement and has its own advantages).
> 
> http://en.wikipedia.org/wiki/Shadow_volume
> http://en.wikipedia.org/wiki/Shadow_mapping

Mmm, interesting.

I'm surprised shadow volumes didn't occur to me before. The intro to HL1 
features what I guess you could call a "light volume": a door opens and 
a semitransparent object representing the light flooding in is revealed. 
(This illusion is then nicely shattered by driving a truck through it 
without altering the geometry! But hey, it probably required no 
alteration to the Quake engine...)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: RK4 is harder than it seems
Date: 4 Aug 2008 12:00:30
Message: <4897279e$1@news.povray.org>
Warp wrote:
>   That's actually one of the limitation of lightmaps:

I thought it was pretty cool that (as I understand it), the Thief 3 game 
actually forces you to mind your shadows. If you're hiding around a 
corner and your shadow sticks out, the guard will notice you. At least, 
that's my understanding. I don't have a machine equiped properly to play 
it here.

-- 
Darren New / San Diego, CA, USA (PST)
  Ever notice how people in a zombie movie never already know how to
  kill zombies? Ask 100 random people in America how to kill someone
  who has reanimated from the dead in a secret viral weapons lab,
  and how many do you think already know you need a head-shot?


Post a reply to this message

From: Warp
Subject: Re: RK4 is harder than it seems
Date: 4 Aug 2008 12:45:51
Message: <4897323f@news.povray.org>
Darren New <dne### [at] sanrrcom> wrote:
> Warp wrote:
> >   That's actually one of the limitation of lightmaps:

> I thought it was pretty cool that (as I understand it), the Thief 3 game 
> actually forces you to mind your shadows. If you're hiding around a 
> corner and your shadow sticks out, the guard will notice you. At least, 
> that's my understanding. I don't have a machine equiped properly to play 
> it here.

  That's one problem I have noticed with new gaming technologies: Most of
them are put into games just for looks, but very seldom actually used
for gameplay.

  For example Doom3 supports accurate shadows for all the objects. However,
it's a purely visual element and plays absolutely no role in the actual
gameplay.

  I don't know if Thief3 uses shadows in the way you describe, but it would
be a rare exception.

  (OTOH, one could argue that something which is rather heavy to calculate
and which can be turned off with a rendering quality settings shouldn't be
a relevant gameplay feature because when it's turned off then it makes
little sense.)

  Another example is physics simulation: Most modern games use Havoc or
some other physics engine, and once again purely for visuals only. There
really aren't many games where the physics engine would actually be a
relevant part of the gameplay. For example, The Elder Scrolls 4: Oblivion
uses Havoc, but the physics engine is not used for *anything* related to
gameplay. It's a purely visual element.

  Half-Life 2 and its sequels are somewhat of a borderline case. It does
use the physics engine for gameplay. However, most of the situations where
it's used could IMO very well be implemented without the physics engine.

  For example, at some points you need to use the gravity gun to pull a
plug (in order to shut down a barrier). The physics engine is used for
this, but it could well be done without it (just move the plug towards
the gravity gun when the user aims properly and fires). So while the
physics engine is used, it's not used for anything that couldn't be done
without one.

  At another point you need to balance a plank to the other side by
putting weights on that side (so that you can then run accross the
plank and jump over the wall). While the physics engine is also used
here, it could still very conceivably be done without one.

  (HL2:Episode 2 has some impressively massive physics simulations at
some points, such as a collapsing bridge. However, these could also be
simply precalculated motion paths, and a physics engine would not really
be needed.)

  OTOH, the physics engine *does* contribute visually a lot, so games
really are better with one. For example throwing a grenade near a pile
of boxes can be visually quite fun. Also ragdoll physics make falling
enemies more realistic in all kinds of terrain, something which is very
difficult to do with precalculated motion paths.

-- 
                                                          - Warp


Post a reply to this message

From: Orchid XP v8
Subject: Re: RK4 is harder than it seems
Date: 4 Aug 2008 13:57:01
Message: <489742ed@news.povray.org>
Warp wrote:

>   That's one problem I have noticed with new gaming technologies: Most of
> them are put into games just for looks, but very seldom actually used
> for gameplay.

Yeah. Eyecandy seems to be the way to go these days.

>   I don't know if Thief3 uses shadows in the way you describe, but it would
> be a rare exception.

Farcry uses (what appears to me to be) a fairly sophisticated foliage 
rendering system, and sure enough much of the game revolves around 
sneaking through the undergrowth trying to avoid being seen. (I have no 
idea to what extent the enemeis "see" like a human does.)

>   (OTOH, one could argue that something which is rather heavy to calculate
> and which can be turned off with a rendering quality settings shouldn't be
> a relevant gameplay feature because when it's turned off then it makes
> little sense.)

When I played in one CSS match, the server operator demanded that all 
players have their game set to DirectX 9 only, to avoid things like 
people not being "properly blinded" by flash grenades. (At least, that 
was their excuse. I'm not sure if it's really true...)

>   (HL2:Episode 2 has some impressively massive physics simulations at
> some points, such as a collapsing bridge. However, these could also be
> simply precalculated motion paths, and a physics engine would not really
> be needed.)

I was under the impression that those really big scenes *are* 
precalculated...

>   OTOH, the physics engine *does* contribute visually a lot, so games
> really are better with one. For example throwing a grenade near a pile
> of boxes can be visually quite fun. Also ragdoll physics make falling
> enemies more realistic in all kinds of terrain, something which is very
> difficult to do with precalculated motion paths.

I guess you're probably the best person to ask about this Warp... How 
"hard" is it to build a working game physics engine? I mean, how easy is 
it to get good framerates? What other problems are involved?

(One thing I notice about all the Steam-powered games is that 
slow-moving objects resting on surfaces sometimes seem to pathologically 
jiggle around apparently without dissapating energy. Which, obviously, 
looks a little weird...)

-- 
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*


Post a reply to this message

From: Darren New
Subject: Re: RK4 is harder than it seems
Date: 4 Aug 2008 14:02:19
Message: <4897442b$1@news.povray.org>
Warp wrote:
>   I don't know if Thief3 uses shadows in the way you describe, but it would
> be a rare exception.

Given it's a sneaker, and given that doing things like leaving doors 
open behind you can get you caught, and making too much noise can get 
you caught, it seems reasonable they'd put that much effort into it. I 
wouldn't think it would be all that much more difficult to have the NPCs 
react to seeing shadows than to the player himself. Especially since 
they only seem to react to the player in the other games. (I.e., make a 
noise, get caught, even if you're standing near others arguing loudly 
next to a pneumatic hammer.)

>   (OTOH, one could argue that something which is rather heavy to calculate
> and which can be turned off with a rendering quality settings shouldn't be
> a relevant gameplay feature because when it's turned off then it makes
> little sense.)

I don't think you can turn it off. The game needs "pixel shader 3" and 
won't run on my "pixel shader 1" cards. Not sure (don't really care) 
what the differences are.

>   For example, at some points you need to use the gravity gun to pull a

Altho if you watch the speed-runs, it's clear the use of the physics 
engines make it possible to do things you wouldn't expect otherwise. 
Like shoot the lever in the tower that holds up the giant logs that 
break the doors down. Or maybe he's shooting the rope. (Took me a couple 
viewings to figure out what he was doing there.)

One of the things in Black&White was the desire to make the physics good 
enough that anything you could do for real you could do in the game. You 
could, in theory, create a ball of water, use it to focus the sun on 
some trees, light them on fire, set a boulder in the fire until it's 
hot, and throw the bolder into another forest to light *that* on fire.

> Also ragdoll physics make falling
> enemies more realistic in all kinds of terrain, 

But nowhere near as fun as watching Jumpman bounce on the way down. ;-)

-- 
Darren New / San Diego, CA, USA (PST)
  Ever notice how people in a zombie movie never already know how to
  kill zombies? Ask 100 random people in America how to kill someone
  who has reanimated from the dead in a secret viral weapons lab,
  and how many do you think already know you need a head-shot?


Post a reply to this message

From: Fredrik Eriksson
Subject: Re: RK4 is harder than it seems
Date: 4 Aug 2008 19:52:02
Message: <op.ufdy8zu77bxctx@e6600>
On Mon, 04 Aug 2008 18:45:51 +0200, Warp <war### [at] tagpovrayorg> wrote:
>   (OTOH, one could argue that something which is rather heavy to  
> calculate and which can be turned off with a rendering quality
> settings shouldn't be a relevant gameplay feature because when
> it's turned off then it makes little sense.)

I remember that in X-Wing the trench run became a lot easier if you  
lowered the detail setting, thus removing most of the obstacles in the  
trench.


-- 
FE


Post a reply to this message

<<< Previous 10 Messages Goto Initial 10 Messages

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.