Planetside Software Forums

General => Terragen Discussion => Topic started by: moodflow on September 13, 2007, 11:31:28 AM

Title: Image Mapped Planets
Post by: moodflow on September 13, 2007, 11:31:28 AM
Has anyone successfully figured this out?  I haven't seen a single image from anyone else that has yet (without post processing). 

Ive tried all types of projection and spent hours and hours with different types of maps (spherical, and square), and no luck.  I've stuck with fractals for now since I can't get this to work properly yet.
Title: Re: Image Mapped Planets
Post by: RArcher on September 13, 2007, 11:52:12 AM
I'm not sure what you are trying to do exactly, but just projecting an image map onto the surface of a planet can be done quite simply.  The moon in this image is straight from TG2 using an image map from here:

http://www.celestiamotherlode.net/catalog/moon.php (http://www.celestiamotherlode.net/catalog/moon.php)

All I have done here is set the Surface Shader of the planet as an image map shader. Then set the projection type to "Through Camera".  Now if you want to be able to rotate the planet and get a different view then obviously you would need to figure out a different projection to use.

Not sure if this helps at all, but if it does, great!
Title: Re: Image Mapped Planets
Post by: nvseal on September 13, 2007, 12:11:21 PM
This image uses spherical projection to get the moon (an image map used as the planet surface). Don't know if that is what you are looking for though.
Title: Re: Image Mapped Planets
Post by: Oshyan on September 13, 2007, 01:40:48 PM
Strange, I've seen quite a number of people doing image mapped planets quite successfully, including my own work here: http://forums.planetside.co.uk/index.php?topic=1175.0

There are only 2 things you need to do once you have your image and have loaded it into an Image Map Shader. 1 - Set projection to Spherical. 2 - Set the position of the image to the same as the Centre of the planet you are going to map. You can leave size at default. With those settings it should work properly right away.

- Oshyan
Title: Re: Image Mapped Planets
Post by: dhavalmistry on September 13, 2007, 02:48:36 PM
something from me....

http://forums.planetside.co.uk/index.php?topic=1090.msg10873#msg10873
Title: Re: Image Mapped Planets
Post by: moodflow on September 13, 2007, 02:51:25 PM
Quote from: RArcher on September 13, 2007, 11:52:12 AM
I'm not sure what you are trying to do exactly, but just projecting an image map onto the surface of a planet can be done quite simply.  The moon in this image is straight from TG2 using an image map from here:

http://www.celestiamotherlode.net/catalog/moon.php (http://www.celestiamotherlode.net/catalog/moon.php)

All I have done here is set the Surface Shader of the planet as an image map shader. Then set the projection type to "Through Camera".  Now if you want to be able to rotate the planet and get a different view then obviously you would need to figure out a different projection to use.

Not sure if this helps at all, but if it does, great!

RArcher:  yes, I am able to do this, but its not a true representation, even though it can come off looking pretty sweet, as shown in your image.
Title: Re: Image Mapped Planets
Post by: moodflow on September 13, 2007, 02:54:57 PM
Quote from: nvseal on September 13, 2007, 12:11:21 PM
This image uses spherical projection to get the moon (an image map used as the planet surface). Don't know if that is what you are looking for though.

NVSeal:  yes, this is what I was looking for, but I can't seem to get the scale right.  Do you know what scale sizes you used in the image map shader?

I've tried nearly every logical projection and scale, and just can't get that tried and true setup, which is odd to me.  It shouldn't be this hard. 

I have managed to get lucky on a few occasions, but I simple swap out the image for another (with the same projection), and then it falls apart.

I'll post some files when I get home from this dreadful real job.
Title: Re: Image Mapped Planets
Post by: Oshyan on September 13, 2007, 02:57:33 PM
Moodflow, read my reply above. I explain exactly how to make it work. ;D

- Oshyan
Title: Re: Image Mapped Planets
Post by: moodflow on September 13, 2007, 02:58:42 PM
Quote from: Oshyan on September 13, 2007, 01:40:48 PM
Strange, I've seen quite a number of people doing image mapped planets quite successfully, including my own work here: http://forums.planetside.co.uk/index.php?topic=1175.0

There are only 2 things you need to do once you have your image and have loaded it into an Image Map Shader. 1 - Set projection to Spherical. 2 - Set the position of the image to the same as the Centre of the planet you are going to map. You can leave size at default. With those settings it should work properly right away.

- Oshyan

Oshyan, you know what, this DOES sound like the solution!  I did not think of this, but now it makes sense.  Reason:  I've noticed when I set the image to spherical projection, the image appears to be semi spherical, like the top 10% of a sphere, rather than 50% of a sphere as it should be.  Shrinking the scale of the image helps to a point, but still no fix.




Title: Re: Image Mapped Planets
Post by: nvseal on September 13, 2007, 02:59:56 PM
As Oshyan said, what you need to do is:
1. Load the image
2. Set the image map as the planet's surface shader
3. Set the image map coordinates the same as the center of your planet

As far as scale goes, the default 1/1 works fine.
Title: Re: Image Mapped Planets
Post by: moodflow on September 13, 2007, 03:19:56 PM
Quote from: nvseal on September 13, 2007, 02:59:56 PM
As Oshyan said, what you need to do is:
1. Load the image
2. Set the image map as the planet's surface shader
3. Set the image map coordinates the same as the center of your planet

As far as scale goes, the default 1/1 works fine.

Yes, #3 is what I failed to do and from the projections I did get, this now all makes sense.  I really appreciate all of your help guys.  Many thanks.


UPDATE:  tested it, and yep, that's how it works.  Perfect every time.
Title: Re: Image Mapped Planets
Post by: sjefen on September 13, 2007, 04:14:07 PM
He heh. I had the very same problem, so...... Thanks ;D
Title: Re: Image Mapped Planets
Post by: bigben on September 13, 2007, 08:42:39 PM
The only drawback to this is that you can't rotate the planet yet. To use the moon as an example, where you only see one side of the moon... most image maps will display the correct face of the moon when positioned at heading 0, altitude 0. A quick hack to get by this is to offset the image map to match the moon's heading. This doesn't compensate for height above the horizon but at least it makes a more recognizable moon

[edit] finally got off my bum and posted a tool for adjusting images as promised earlier
http://forums.planetside.co.uk/index.php?topic=2311.0 (http://forums.planetside.co.uk/index.php?topic=2311.0)

Sample moons positioned around heading 180°, elevation 30°[/edit]
Title: Re: Image Mapped Planets
Post by: moodflow on September 14, 2007, 12:10:49 PM
I was noticing this too.  Thanks for the workaround BigBen.