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.

Author
Message
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Dec 2004 10:33 Edited at: 17th Dec 2004 02:40
Hi all,

A little function that can render a skysphere from any scene - uses the camera and point so it's real slow with high resolutions. Check out the example, there's code to display the results too.

The skybox is one of Clueless's.

I wanna see some 3D screenshots - just remember it'll take ages to render, the one I've attached took about 3 hours [1600 Athlon w. GF5200].

Code:



It's c**p being the only coder in the village.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Dec 2004 22:13
C'mon - are you guys telling me staying up late to post that render was a waste of time?

Made it simpler... download the .png I attached and save it somewhere, then use this code to show the special screenshot.



I'm not sure what the technical term is for those 3D images that you look around with your mouse, but that's basically what this does to your DBPro scenes.


Van-B


It's c**p being the only coder in the village.
spooky
22
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 16th Dec 2004 23:15
I will have a play tonight. I like skyboxes and skyspheres and your code looks very interesting.

Your attachment does not work by the way.

Boo!
Vues3d on Kalimee
20
Years of Service
User Offline
Joined: 12th May 2004
Location: NYON (SWITZERLAND)
Posted: 16th Dec 2004 23:23
Nope!!!
Attachemnt doesn't work... but I will have a try tonight!!!
Awaiting to see the final result on a map.

Guido
http://www.vues3d.com
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 16th Dec 2004 23:26
Arghhh!!! - sorry, I'll get it fixed soon, damn 1.02mb image!.

It's 1024x1024 you see, as a .png it's slightly over, as a zip it's about the same - I might have to tarnish it with .jpg badness .


Van-B


It's c**p being the only coder in the village.
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 17th Dec 2004 00:55 Edited at: 17th Dec 2004 00:57
The built in point command is pretty slow.

You could try this:



I haven't tested it. Should work though.

It would be even faster to lock the backbuffer and read off dwords straight from there.

EDIT______

Just saw what you're doing.
It would be fastest to make a memblock 3 bytes big and use copy memory to copy off bytes from the backbuffer to the memblock.

Remember that they're held in reverse order for some reason.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 17th Dec 2004 00:59
Thanks for that Chris - I'll check that out very soon.

The thing is, the whole screen changes when rendering a specific pixel, so locking the pixels would'nt work - I have noticed the massive speed increase with that though.

Here's that skysphere as a .jpg. You will have to modify the code so it reads the correct filename (second post) - but it is worth checking out.


Van-B


It's c**p being the only coder in the village.

Attachments

Login to view attachments
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 17th Dec 2004 01:05
You don't seem to be calling point very often.

Maybe it's because you're writing straight to the file?
It would be faster to make the whole 'file' in a memblock in the RAM (assuming wrting to file writes to the HD) then make a file from the memblock at the end.

Three hours seems excessive though.
You should be able to do it in two minutes or so.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 17th Dec 2004 01:14
Well with a 1024 res skysphere, that's....

1,048,576 point checks :/ - it should be faster, once I try out that replacement point idea, I hope it'll be faster. I did'nt get the chance to try any optimisations - like drawing to a small area of screen to increase the speed, and adjusting the FOV to suit - that seems to work ok with some things.


Van-B


It's c**p being the only coder in the village.
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 17th Dec 2004 01:23
But running this:



Seems to suggest it can do about 200,000 checks a second.
That's from 100x100 checks a sync and 20 FPS.

I don't think that's what's causing the slowdown.
Chris K
21
Years of Service
User Offline
Joined: 7th Oct 2003
Location: Lake Hylia
Posted: 17th Dec 2004 01:29 Edited at: 17th Dec 2004 01:29
Just tested my FastPoint() function and in doesn't seem to work properly in XP.

On my old computer it was a lot faster that point() but on this one it seems slower!

Unless I'm doing something stupid...

Anyway, my diagnosis is that it's the writing to file and not the point()ing that's slowing it down.
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 17th Dec 2004 01:49 Edited at: 17th Dec 2004 02:37
Yeah - I don't think it's entirely XP's fault though, it works in 2000 - but the speed is about the same as point.

I tested some renders at 128x128:

fast point=57724
normal point=57462
no file output=54813

DBPro is actually fairly quick at writing to files - it's fast enough to allow a undo feature in vanmesh at least (like saving to buffer files that can be loaded back in when undoing). I think it's just it's way - I'm gonna mess around and see if I can improve anything with limited rendering.

Thanks for your input Chris - much appreciated .

Incidently - I tried my test render as a skysphere in the same engine that it was rendered in, and it blends nicely, but the example render is far from ideal as a skysphere (tis really just a fancy screenshot). Screenie attached.

EDIT: Just setup the camera focus area and got it rendering a 1024x1024 image in around 30 minutes - It'll do for now, it takes my PC that long to render skyboxes in Terragen, so I can live with it.


Van-B


It's c**p being the only coder in the village.

Attachments

Login to view attachments
Clueless
20
Years of Service
User Offline
Joined: 16th Feb 2004
Location: Corbin, KY, USA
Posted: 17th Dec 2004 08:21
Quote: " Just setup the camera focus area and got it rendering a 1024x1024 image in around 30 minutes"


That's actually not that bad of a rendering time Van B. If I do the Bryce skybox renders at that resolution and have a very complicated scene, I'm looking at enough spare time to go eat dinner, at least when any type of anti-aliasing is involved.

I still haven't made it home from work to play with your new toy, just wanted to check in and say it looks good so far...
xtom
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Ireland
Posted: 18th Dec 2004 00:34
Cool Program, are you posting a faster version? I was going to try the original out but quit it at 98%
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 18th Dec 2004 01:42
Ahh, forgot to say, I posted the faster version over the original snippet, on the first post. It changes the FOV and camera draw area - so it might mess up your engine or whatever after rendering.


Van-B


It's c**p being the only coder in the village.
Fud
20
Years of Service
User Offline
Joined: 16th Nov 2004
Location:
Posted: 29th Dec 2004 18:59
Pricey
21
Years of Service
User Offline
Joined: 22nd Feb 2003
Location:
Posted: 30th Dec 2004 00:47
Wtf?

:: 1.8 gHZ AMD Duron :: 256 MB Ram :: 32 MB SiS Graphics ::

:: Current Project: Sea Bound ::

Login to post a reply

Server time is: 2024-11-27 04:13:05
Your offset time is: 2024-11-27 04:13:05