Earth

Community Forums/Graphic Chat/Earth

Chroma(Posted 2006) [#1]
I started tinkering around with a planet using Mustang's method (I think). It looks 'ok'. Still a long way to go. Part of the problem is the sphere uv's aren't 100% right.

A bump and specular map would really make this come alive. And of course the atmosphere glow and alpha cloud layer too.




John Blackledge(Posted 2006) [#2]
Looking very good so far, particularly the light-to-dark gradient (from right to left); mine looked completely 'hard' and jagged across the edge faces - yours looks smooth and realistic.

Please say that you'll be issuing a code snippet?


QuickSilva(Posted 2006) [#3]
Just out of interest did Mustang ever release his example?

Jason.


ICECAP(Posted 2006) [#4]
Hey go to this post... Might be of interest...

http://www.blitzbasic.com/Community/posts.php?topic=63088


Mustang(Posted 2006) [#5]

Just out of interest did Mustang ever release his example?



Nope. Got fed up with (some) peoples demands, comments and requests... but mainly because at that time I also did a trip to Thailand, sold our old house, bought bigger one, had to move and then some other things. Maybe my irritation / stress levels were bit lower than usual because of that, but the end result was what it was.

I still use it for my own purposes, but have also another project going on so it has been on a backburner for a while... summers are better used for something else than sitting insde four walls and coding :)

I still intend to release the latest (last) version of my planet someday, but I've learned not to promise anything or give out any release estimates - "when it's done" is what I should have used, that works always! I can give out info how it was done though. And sorry for images not showing up because I'm into process of getting another domain and transferng & creating new stuff to my future portfolio website.


Chroma(Posted 2006) [#6]
Take your time Mustang. =) Any chance you can post a pic or email it to me so I can see what to shoot for?

What would be cool...is to have a night earth texture and a day earth texture and show the night texture on the left side and day on the right with vertex alpha blending them where they meet. Then being able to rotate that alpha blending so the day side always faces the sun. Then of course have the bump/specular thing going on too.

I'm no texturing virtuoso for sure. But I'm trying.


Mustang(Posted 2006) [#7]

Any chance you can post a pic or email it to me so I can see what to shoot for?



Tomorrow - check the other thread :)


What would be cool...is to have a night earth texture and a day earth texture and show the night texture on the left side and day on the right with vertex alpha blending them where they meet.



Yup - I did that... not using VA, but the end result was the same. Hit a snag when I tried to optimize it but got later much simpler idea how NOT to show "cities-at-night" lights on the bright/day side of the planet.


Mustang(Posted 2006) [#8]
Posted! Check the other thread.


puki(Posted 2006) [#9]
This looks great - can I have it?


Chroma(Posted 2006) [#10]
Here's my latest. And I still have a long way to go.




Chroma(Posted 2006) [#11]
Here's another shot.

Here's another one.



Mustang(Posted 2006) [#12]
Hey, That looks nice! REALLY nice.


Pete Carter(Posted 2006) [#13]
lights from citys on the night side is a realy nice touch. very nice mate.

we should put together a community space trading game.

ill make some ships and space stations.

Pete


Boiled Sweets(Posted 2006) [#14]
Woah! How did you get the detail?


Chroma(Posted 2006) [#15]
Really high resolution maps. Probably too high hehe. Those are 4k atm, but I'm gonna get them down to 2048 and try to not lose too much detail. In the end it's gonna come down to the player choosing the detail settings. But the option will be there to put your graphics card to work.

Finally got the setting right for the lights. They are only visible on the dark side of the earth.




Mustang(Posted 2006) [#16]
How did you do the citylights? I had a lot of problems with my citylights the so I'm asking if you have invented better way to do them... :)

Also... am I seeing things or is it so that the light direction and (bump) shadow direction do not match in the lates pic? How's that?


Chroma(Posted 2006) [#17]
I'm pretty sure in the last pic I had taken the normal map and scaled it down to 2k and blurred it a little for experimental purposes. That might be what caused that. Or, it could be a side effect of the city lights map.

The normal map is on layer 0. City lights map on layer 1. And color map on layer 2. I found that if you don't do them in exactly that order it won't hide the lights in the daylight.

Global earth = CreateSphere(32)

nmap = LoadTexture("nmap.jpg") ; normal map
clmap = LoadTexture("clmap.jpg") ; city lights map
cmap = LoadTexture("cmap.jpg") ; color map

TextureBlend nmap,4
TextureBlend clmap,3
TextureBlend cmap,5

EntityTexture earth,nmap,0,0
EntityTexture earth,clmap,0,1
EntityTexture earth,cmap,0,2

sunlight = CreateLight()
PositionEntity sunlight,0,0,-2000



Boiled Sweets(Posted 2006) [#18]
Will you be sharing this, i.e. the maps?


OrcSlayer(Posted 2006) [#19]
Very interesting. Chroma I don't know what gameplay you decided on but wow, you really figured out how to make the planets look good!

Just curious, does this involve a DLL or is it pure blitz?


Mustang(Posted 2006) [#20]
Boiled,
Chroma paid money for the maps - but you can get the same maps for free from NASA.

Chroma,
how did you manage to lose the citylights from the dayside, I'm still not getting it... it looks like you are using plain old additive blending like I did - but then they should show up on the day side as well? At least they did on my first version. I had to manually check if tri is pointing towards the light (sun) and either a) delete it or b) paint it black (for additive) to get them behave.

Ummm... wait a minute, you have COLOR map on TOP of the citylights, using M2X... that must do it although why it does (the math) that is not clear to. I used "traditional" method of COLOR folowed by ADDITIVE, you have NORMAL, the ADDITIVE and then COLOR - pretty pervert order IMO but hey, if it works... have to try this myself! :)


I had taken the normal map and scaled it down to 2k and blurred it a little for experimental purposes. That might be what caused that. Or, it could be a side effect of the city lights map.



Scaling & blurring wouldn't alter the normal vectors enough to cause something like this... I'm betting that your layering order and blend modes cause it somehow more likely. And they seem to be 90 deg off, not 180... light seems to come from SW (south-west), but bum shadows seem to have ligh S-SE's?


Chroma(Posted 2006) [#21]
I paid $8 in haste. I should have just researched a bit more and got them from NASA. Lesson learned.

On the first go, I had the normal map on layer 0, color on layer 1, and city lights on layer 2. The lights would appear in the day side. I then swapped the color and city lights layers and it worked.

I do have issues though. Like you said, the normal seems to be off a bit and also, lighter areas of the color map are very very bright (white). So bright that you can't see the details of the desert and they're saturated white. I'm still trying to figure out how to tone down the brightness of the very light areas. Any ideas?

EDIT: Also, by putting the lights 'under' the color map, the lights on the green areas look a bit washed...like their being slightly filtered thru the green foilage.


Chroma(Posted 2006) [#22]
@ Orc: It's all in straight B3D.

@ BSweets: Yep the maps are availabled from NASA for free. You just have to mention them in the game credits if it's commercial.

I think this can be improved a lot more too. The lights can be more vivid. The light fadeout process could be timed better with the shadow. The normal/bump isn't working correctly atm either. Plus I haven't even started experimenting with the specular maps.

It would be phenomenal to be flying along in your ship, see Earth from space in high detail, then actually fly down and enter the Earth's atmosphere. A system to handle this process is doable. But of course one step at a time. Current goal: Make Earth look as realistic as possible from orbit.


Chroma(Posted 2006) [#23]
A few questions:

I notice in order to get the normal map to work properly you have to set up separate red, green, and blue lights and rotate them all funky. Is this normal? Because every other object in the game will have those color overtones unless they're set to full bright.

It would be nice if you could assign light to affect certain objects only.

Something like:
light = CreateLight()

cube = CreateCube()
EntityLight cube,light


In theory the light would effect everything unless the EntityLight command was used on it. Then it would only affect the object it was assigned to. This way you could assign lights used specifically to make normal maps work correctly and not affect other objects that dont' use normal maps.

EDIT: I'll check out the LightMesh command when I get home. Maybe it will do the trick.


Mustang(Posted 2006) [#24]

you have to set up separate red, green, and blue lights and rotate them all funky. Is this normal?



No! Problem with normal maps in Blitz is that it supports only world space normal maps and that means trouble lightingwise... tangent space would be so much easier for the user if implemented correwctly. Cubemap lighting together with normal maps work somewhat but having rotating planet and sun can be problematic.

Normal maps are NOT like your average bumpmaps; they work differently and are more prone to tech issues. I don't have any normal maps on my planet yet because I have not been able to solve the moving light and planet issue satifactorily yet.

Being able to include / exclude objects from / to lights would be handy, like using reverse lighting on citylights... but that would require a lot of base tech coding from Mark.


Chroma(Posted 2006) [#25]
Ah! So I need to use bump maps instead.

Let me ask me make a few assumptions. Lemme know if I'm off.

1. Bump maps and normal maps do pretty much the same thing.

Answer me this riddle: What is the prefered method to blend a bump map on an object along with the color map?

EDIT: I just found Tom's bump map solution and I'm gonna have a go at it when I get home.


Mustang(Posted 2006) [#26]

Ah! So I need to use bump maps instead.



Ummm... maybe, but Blitz doesn't support them officially anyway. Bumps in Blitz is pretty hard to do, no matter what... but Tom's EMBM would be your best bet I think.

I wonder why BRL imlemented DOT3/normal stuff in the first place instead of EMBM - normal maps are so much harder to generate and use for the average Blitz coder compared to EMBM. And it does not help that BRL choose to support only world/object space normal maps (easier for them to code I guess) instead of tangent space ones. World/object space is pretty much useless format, we use only tangent at work. Tangent space is also the only format that works with changing geometry like boned characters. You can also mirror (save map space) tangent space geometry like left/right side of the character - impossible with world/object space version.

http://www.matrox.com/mga/theguide/contents/embm.cfm


Chroma(Posted 2006) [#27]
EMBM is implemented through Microsoft's DirectX® 6.0 API. To support EMBM, a game developer simply needs to code a few DirectX 6 render states and texture stages, in addition to creating a bump map for each texture that represents height or depth of each pixel of the texture.


I wish this could have been included in B3D natively. Heck it's been available since DX6!

I've been messing about with Tom's EMBM but haven't been able to get regular bump mapping to work. Also I get a lot of noise on the object that I am trying to bump map.