It is currently Fri, 22-06-18, 14:39 GMT

All times are UTC




Post new topic Reply to topic  [ 96 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next
Author Message
 Post subject:
PostPosted: Tue, 13-11-07, 23:11 GMT 
Offline
User avatar

Joined: Wed, 05-09-07, 0:09 GMT
Posts: 57
Location: Seattle, WA, USA
ElChristou wrote:
t00fri wrote:
But of course. You just need to be able to compile and have the libpng ready.

...and sorry you must ask DW to write you a neat little Makefile ;-)

F.


Well, that's precisely the kind of stuff were DW is still indispensable for us osX end users... :|

Chris, quick question, your code above need OGL2 to render the scene? (or it's a pure raytrace?)


It's a pure ray tracer. I'm working on accelerating it with lookup tables (similar to what will be used in the OGL2 implementation in Celestia), but that's not quite working yet in the case when the viewer is inside the atmosphere. The speedup from lookup tables is huge.

--Chris


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 13-11-07, 23:16 GMT 
Offline
User avatar

Joined: Thu, 25-10-07, 15:20 GMT
Posts: 992
Location: NE PA, USA
Chris,
Nice Avatar! This is program is really cool. :D A quick way to see the effect of the settings. One note though. I had to copy lib/libpng1.lib and rename it to lib/libpng.lib to get it to link. These were in the lib folder from winlibs. I use the Microsoft Visual C++ Toolkit 2003.
cartrite


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 13-11-07, 23:18 GMT 
Online
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4566
Location: Hamburg, Germany
cartrite wrote:
Chris,
Nice Avatar! This is program is really cool. :D A quick way to see the effect of the settings. One note though. I had to copy lib/libpng1.lib and rename it to lib/libpng.lib to get it to link. These were in the lib folder from winlibs. I use the Microsoft Visual C++ Toolkit 2003.
cartrite


Correct. That's what I did, too. And then everything worked fine.

F.


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 13-11-07, 23:25 GMT 
Offline
User avatar

Joined: Thu, 25-10-07, 15:20 GMT
Posts: 992
Location: NE PA, USA
I can run it on Linux too by using Wine. :D
cartrite


Top
 Profile  
 
 Post subject:
PostPosted: Tue, 13-11-07, 23:33 GMT 
Online
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4566
Location: Hamburg, Germany
cartrite wrote:
I can run it on Linux too by using Wine. :D
cartrite


But it really should be easy to compile under Linux. Just needs libpng and zlib. The makefile can easily be ported.

F.


Top
 Profile  
 
 Post subject:
PostPosted: Wed, 14-11-07, 2:48 GMT 
Offline
User avatar

Joined: Tue, 04-09-07, 2:32 GMT
Posts: 431
Location: South Korea
I haven't really looked at the new atmosphere tool yet.
I want to try it on Venus at some point.
Not sure yet how much work it'd be to write a Makefile (or an xcode project?) and compile a Mac version.
Once it's done, maybe the app could be hosted here?


Top
 Profile  
 
 Post subject:
PostPosted: Wed, 14-11-07, 5:38 GMT 
Offline
Site Admin
User avatar

Joined: Thu, 30-08-07, 22:52 GMT
Posts: 2726
Location: France, South, not far from Montpellier
dirkpitt wrote:
I haven't really looked at the new atmosphere tool yet.
I want to try it on Venus at some point.
Not sure yet how much work it'd be to write a Makefile (or an xcode project?) and compile a Mac version.
Once it's done, maybe the app could be hosted here?


A xcode project would be great, this way we could all be able to build just like for Celestia!
(And the app of course could be go next your other tools)


Top
 Profile  
 
 Post subject:
PostPosted: Thu, 15-11-07, 2:06 GMT 
Offline
User avatar

Joined: Wed, 05-09-07, 0:09 GMT
Posts: 57
Location: Seattle, WA, USA
I built a Mac version with a very hackish Makefile:

http://www.shatters.net/~claurel/celest ... im-mac.zip

It's command line only. Unpack the zip, then go into the directory scattersim.app/scattersim and run it:

scattersim -l earth.cfg

...and you should get a nice image in out.png. The -l option tells scattersim to use lookup tables to accelerate calculations. Any differences from the image generated without lookup tables should be very minor. You can omit the -l options if you're seeing something peculiar in the output that might be caused by the optimization. Use it the rest of the time because it makes the program run much faster. Here are the rest of the options:

Usage: scattersim [options] <config file>
--lut (or -l) : accelerate calculation by using a lookup table
--width <value> (or -w) : set width of output image
--height <value> (or -h) : set height of output image
--image <filename> (or -i) : set filename of output image
(default is out.png)
--depthsteps <value> (or -d)
set the number of integration steps for depth
--scattersteps <value> (or -s)
set the number of integration steps for scattering

I'll explain the contents of the cfg files later; if you're familiar with the new Celestia 1.5.0 atmospheres, you'll recognize that the parameters are very similar.

--Chris


Top
 Profile  
 
 Post subject:
PostPosted: Thu, 15-11-07, 2:12 GMT 
Offline
User avatar

Joined: Wed, 05-09-07, 0:09 GMT
Posts: 57
Location: Seattle, WA, USA
Forgot to mention . . . There are two binaries: scattersim (for Intel Macs) and scattersim-ppc (for PowerPC).

--Chris


Top
 Profile  
 
 Post subject:
PostPosted: Thu, 15-11-07, 4:36 GMT 
Offline
User avatar

Joined: Tue, 04-09-07, 2:32 GMT
Posts: 431
Location: South Korea
Thanks Chris, will have to try this out soon.


Top
 Profile  
 
 Post subject:
PostPosted: Thu, 15-11-07, 9:55 GMT 
Offline
Site Admin
User avatar

Joined: Thu, 30-08-07, 22:52 GMT
Posts: 2726
Location: France, South, not far from Montpellier
TX Chris.


Top
 Profile  
 
 Post subject:
PostPosted: Thu, 15-11-07, 20:00 GMT 
Online
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4566
Location: Hamburg, Germany
I wrote a simple Makefile for Linux affectionados to compile Chris L's 'scattersim' in Celestia-CVS under Linux. The PNG library 'libpng' is assumed to be installed, of course. Here is the Makefile. It's supposed to be called in the directory celestia/src/tools/atmosphere of the Celestia source distribution. I will commit it to Celestia CVS shortly.

-----------------Makefile-------------------------------------------
CXX = g++
CXXFLAGS = -O3 -Wall # -msse -msse2
INSTALL = /usr/bin/install

# scattersim will be installed into

prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin


all: scattersim

scattersim: scattersim.cpp
$(CXX) $(CXXFLAGS) -I../.. scattersim.cpp -o scattersim -lpng
clean:
rm -f *.o
install:
$(INSTALL) scattersim $(bindir)
uninstall:
rm -f $(bindir)/scattersim

---------------------------------------------------------------

It works very well for me.

Bye Fridger


Last edited by t00fri on Thu, 15-11-07, 20:45 GMT, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu, 15-11-07, 20:19 GMT 
Online
Site Admin
User avatar

Joined: Fri, 31-08-07, 7:01 GMT
Posts: 4566
Location: Hamburg, Germany
The result of the call

> scattersim -l -w 1024 -h 1024 earth.cfg

seems to exhibit still some strange artefacts in the image in topright position:

See here:
Image

See the "interference stripes" at the horizon?

Bye Fridger


Top
 Profile  
 
 Post subject:
PostPosted: Thu, 15-11-07, 20:38 GMT 
Offline
User avatar

Joined: Wed, 05-09-07, 0:09 GMT
Posts: 57
Location: Seattle, WA, USA
t00fri wrote:
The result of the call

> scattersim -l -w 1024 -h 1024 earth.cfg

seems to exhibit still some strange artefacts in the image in topright position:



You're right . . . I hadn't noticed it in the smaller views. I'm looking into it now--it's quite tricky to use the lookup tables properly.

--Chris


Top
 Profile  
 
 Post subject:
PostPosted: Thu, 15-11-07, 21:19 GMT 
Offline
User avatar

Joined: Wed, 05-09-07, 0:09 GMT
Posts: 57
Location: Seattle, WA, USA
chris wrote:
t00fri wrote:
The result of the call

> scattersim -l -w 1024 -h 1024 earth.cfg

seems to exhibit still some strange artefacts in the image in topright position:



You're right . . . I hadn't noticed it in the smaller views. I'm looking into it now--it's quite tricky to use the lookup tables properly.

--Chris


It looks like they're artifacts of bilinear interpolation in the extinction lookup table. I think that I probably need to change my approach slightly and create a lookup table of optical depths, then compute the extinction from that. The optical depth doesn't vary linearly either (with view height and angle), but it's much closer to linear than extinction, which is exp(optical depth).

You can work around the problem for now by increasing the size of the extinction lookup table: in scattersim.cpp, adjust the constant ExtinctionLUTViewAngleSteps from 256 to 512.

--Chris


Last edited by chris on Thu, 15-11-07, 21:25 GMT, edited 1 time in total.

Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 96 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6, 7  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group