View Full Version : Planet Shader for Unreal 3
10-28-2009, 11:13 PM
Been having this idea in my head for a while to build a planet shader for the unreal 3 engine using height maps as an input, and generating other details and masks procedurally. In my shameful joblessness, I was able to find some time to do this.
And because i don't want to type a 2000 page description of the functionality, i thought i'd just demo it and put it on the interwebz for all to gawk at.
And for you fools who are too busy to watch a demonstration, here are some screenshots to entice you into clicking the link. :-D
this is the result, after a good 3-4 hours work.
10-28-2009, 11:50 PM
Man that's some intense shader awesomeness! I would love to know how to make more advance shaders like this one. Good luck with the job hunt, I hope someone scoops you up after seeing stuff like this.
10-29-2009, 03:06 AM
Thats really neat, it was more awesome you made it all editable in a parameter.
It'd be cool seeing this used in some mod, awesome.
10-29-2009, 08:38 AM
great stuff, seems pretty complex to make it this editabe :)
The planet is lacking actual glow around its edge and water/terrain transitions look a bit too sharp to me.
Great job on that anyways, i wouldn't be able to do that complex thing myself, just sharing aesthetical thoughts ;)
10-29-2009, 09:07 AM
Sorry my sound is low...so this is the mars surface?
Converting to a height map then showing the water on the low points spilling in I thought was pretty cool. NASA could probably use something like this to simulate what mars might have looked like eons ago... :)
10-29-2009, 11:32 AM
all of your fx are awesome, great job on this one
10-29-2009, 08:33 PM
Thanks guys, I'm going to work on adding some glow functionality to give it some bloom along the edges.
10-30-2009, 02:10 AM
great stuff mate! agree about the water/land transition being a bit too hard. Also, maybe a good idea to exclude the clouds from the water specular?
10-30-2009, 09:19 AM
Great stuff, I love the fx you have on your portfolio.
10-30-2009, 12:36 PM
awesome! Your first piece in the fx reel came out really good!
nice one :)
î'd say use a lerp instead of an if to blend between water and land and snow/land right now the edge looks very hard 1bit but you could actually blend that more, i mean you have all the data there, your map is not just 1bit, so use that power :)
also you could do a lot more work on the clouds, to make em look way cooler, build up or fade away and such things, you could even give them some kind of flow instead of just rotating them over the surface, seeing this makes me want to fiddle around with that shader :D
10-31-2009, 07:50 AM
VERY nice work man, thanks! The functionality video is great!
10-31-2009, 08:33 PM
Hey thanks guys, Neox, if you don't mind, could you either send me a PM or get a hold of me on AIM (urtypicalmoron)... I seen the shader work in Airborn and i would love to pick your brain and get some tips off of you.
As for the if statement, the if statement actually creates the alpha input of a lerp statement that blends the ground and vegetation layers with the water layer. The same mask also feeds into the alpha channel of a lerp expression between the detail normal of the water, and the normal map of the planet's surface. So these maps are dynamically updating. The masks update dynamically depending on what you want the water level to be. I would love to learn how to blend the sharp transition tho. I admit i don't know as much about shader tech as i would like to know, so i want to learn more. If you want to fiddle in the shader i'll be happy to supply you with the UPK. I'm not using it for anything, but wouldn't mind making it the best that it could be, and slapping a CC liscence on it for the mod community, but before i do that i need it to look good.
Also i want to point out that although it seems like an excuse, the shader was never intended to be used for close ups... it was designed to be more of an approximation of what a planet could look like from a geosynchronous orbit (22,000 miles out, depending on the radius of the planet.) If you were to get any closer the map files would have to be alot bigger and use alot more resources (mix maps, height maps, etc. Right now the shader is using heightmaps that are 1024x512.
I was thinking of trying to create a procedural cloud system that has some noise maps flowing through the UV coordinates to create a dynamic "Flow" as you were saying, but am not sure the best method to do this. I would love to get some input on this or maybe some reference.
I really want to make this shader awesome, so any help and critique i can get would be awesome.
Thanks guys :-)
11-01-2009, 05:34 AM
This is already a Awesome shader! Very clever made. :) A random function somehow would be great, that changes all values and you get a whole different planet generated in a sec. A beaches color would be nice and maybe deserts somehow. Maybe makeing it connected to temperature change that goes from top pole to middle to bottom pole , so similiar to our planet. :) At the top and bottom is more snow and in the middle are more deserts.
hmmmmm might be possible in newer builds with custom code, but you can't (or at least i can't as i don't know how) create a random value in the material editor, you can in kismet so maybe thats a way to do such a thing but its not possibe in the material or MIC editor
11-01-2009, 07:26 AM
you could make a noise texture, and then get with uv scale on 1 pixel of it, then you could make a random seed value which controls the position of that 1 pixel uv. So if you have a 256x256 texture you have already 65536 possibilities. to make every settings value different just make +10 u for every value, so for example random seed = 56, earth color u pos= 56 + 10, water color u pos = 56 + 20, ...
Its no real random, but basicly it does the trick.
11-01-2009, 12:03 PM
The pole idea is possible... Alot of the trick of this shader depends on the actual model you apply it to. For instance, like i said in the demonstration, the planet in the material view has vertex paint to blend between the base color and vegetation color. I think it would be pretty easy to apply a second Top down UV set and just plop the "Ice caps" map over what i already have. This would increase the texture samples from 6 to 8, as the icecaps would need a normal map. I th ink the main challenge right now, however, is to find a way to create an expression that changes the 1 bit mask to something thats 16 bits, so i have a smooth transition... I have NO CLUE how to do this tho.
We should get together and develop some new material expressions that can be added to the editor. That would be pimpin.
Davision i understand your random Seed idea and i think it's cool.
If i understand correctly i could mask each channel of a Texture Coordinate expression, then have a constant 10, multiplied by a scaler paramater, and then add that to the masked texture coordinate, then append both inputs back together and plug it in to the UVs of the noise channel.. i'm te sting it now.
just don't use if, if always is 1 and 0 so you could also just do some mask and increase the contrast and use that as the mask for the lerp instead of an if
11-01-2009, 04:43 PM
Hi iv actually done something very similar, though mine uses vertex painting for the terain and details instead of masks.
02-16-2011, 07:21 AM
I have sent you a message, any possibility of explaining a little bit more, how you have integrated the heightmaps? Or maybe some sample of the map?
04-02-2011, 08:13 AM
Been learning alot from, sorry about resurrecting an ancient thread, but i was wondering - how do you handle the atmosphere and clouds if your staticmesh has multiple elements.
Reason im asking is because im working on a planet thats basically cube mapped, with 6 different textures for a high resolution result.
Im thinking though that it would probably be better to create seperate SM's, one for the clouds and one for the atmosphere.
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.