Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Geek Culture / Reflection Effect - Can you guess how it's done?

Author
Message
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 17th Jul 2005 18:59 Edited at: 17th Jul 2005 19:00
Everybody always told me that it was impossible to have semi-transparent real time reflections in DBPro (without shaders), but I've just done it.

Here's some pics:


So can anyone guess how it's done? It doesn't use set reflection shading on (in fact it's quite a bit faster than that).

It doesn't need any fancy graphics-stuff (3d card, shaders, etc.), you could have definately integrated it into HL1, UT etc. (that generation of games)

My Showcase - It's DBpro-tastic

Attachments

Login to view attachments
DBAlex
20
Years of Service
User Offline
Joined: 4th Oct 2004
Location: United Kingdom
Posted: 17th Jul 2005 19:02 Edited at: 17th Jul 2005 19:03
Just looks like set alpha mapping on objnum,amount .

Well to me anyway... Please try and add a larger image to prove me wrong...

EDIT: Im using it in my particle engine too



[/QuickPlug]


AMD 64 3000 + 512mb RAM + 80GB HD + Radeon 9600se 128mb
http://www.dbastudios.cjb.net
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 17th Jul 2005 19:11 Edited at: 17th Jul 2005 19:11


As far as I know set alpha mapping on does not result in real time reflections (?!)

My Showcase - It's DBpro-tastic

Attachments

Login to view attachments
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 17th Jul 2005 19:44
Several ways:

1. Second Camera Set to Texture
2. Buffer Camera
3. Trace Drawing
4. Cliped Object Instance (very common method used in 1998-2001 games, some made a verion of it for the DB 1.08 Release CD)

Those are the ones that just come to mind.

Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 17th Jul 2005 20:08
Can you explain all of those please? It might be one of them... I don't know.

For example, for the first one say where the camera is, it's FOV, angle etc. The other three I don't know at all, could you explain them.

My Showcase - It's DBpro-tastic
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 17th Jul 2005 22:54
I toyed with using a second camera a couple years ago, where you'd place the camera looking out from the 'pond' and then texture the pond with the image produced by that camera. Unfortunately, a camera doesn't work exactly like a mirror and so it was very hard to get the objects the correct size and proportion (1:1). Although there are now some articles on VCP which describe some mathematics to correct this issue, I haven't personally gone over them.


"Computers are useless, they can only give you answers."
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 17th Jul 2005 23:47
What a surprise.... Raven doesn't explain.

Oh well.... What's VCP?

My Showcase - It's DBpro-tastic
Louiz ofRohr
20
Years of Service
User Offline
Joined: 11th Nov 2004
Location:
Posted: 18th Jul 2005 03:32 Edited at: 18th Jul 2005 04:31
Quote: "Unfortunately, a camera doesn't work exactly like a mirror and so it was very hard to get the objects the correct size and proportion"


I used that one time, and worked very nice for me..
To get the current object size and proportion, you must to
put the camera that is looking at charater and the camera
used in the mirror with equal properties..
Then you have to place the camera in the surface of the mirror
and point it 90° from the plain (the camera moves and rotates on this plain
by the main camera's movements and rotations)

The worst foe lies within the self...
Drew Cameron
20
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 18th Jul 2005 05:16
How did you do it, Chris?


Katie Holmes does not endorse D&C or Drew Cameron.
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 18th Jul 2005 05:31 Edited at: 18th Jul 2005 05:33
It's kind of hard to explain but I'll try...

Basically, What the reflection should show is what the secondary camera is seeing, as you can see in the picture.



It uses a special plain which is deformed based on where the camera is to counter act the perspective, so the front edge is actually smaller than the back edge. This plain is rotated so it always faces the camera. The secondary camera is set to an image, then just the area which is the plain is grabbed (dummy objects on the corners get screen x, y which are converted from 640x480 (or whatever) to 256x256, then this image is used to texture the plain.

There's basically loads of crap going on so that you can basically sprite the image, but onto a 3D surface.

My Showcase - It's DBpro-tastic

Attachments

Login to view attachments
Drew Cameron
20
Years of Service
User Offline
Joined: 30th Jan 2004
Location: Scotland
Posted: 18th Jul 2005 05:34 Edited at: 18th Jul 2005 05:34
Is it very fast?
I'm impressed by the way!


Katie Holmes does not endorse D&C or Drew Cameron.
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 18th Jul 2005 06:35
Yeah, it's pretty fast I think.

I don't know quite how fast because my computer is craptacular at 3D (Dumbo and Cool runs at a solid 24 FPS) but the little pond demo runs at around 32FPS for me. It's definately faster than reflection shading (25FPS on same demo).

As soon as DBspot is back up I'll upload the demo so you can see how fast it is for you. RARed up it's 1.05 MB... just too big to upload on the forums.

My Showcase - It's DBpro-tastic
Dave J
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Feb 2003
Location: Secret Military Pub, Down Under
Posted: 18th Jul 2005 11:11
VCP is pretty much what you're doing there, anyway: http://www.gamedev.net/reference/articles/article2023.asp


"Computers are useless, they can only give you answers."

Login to post a reply

Server time is: 2024-11-27 19:43:45
Your offset time is: 2024-11-27 19:43:45