- Home /
Realistic Sun
I am making a space game and I trying find the best way to make my sun look absolutly realistic. I am following this guide to make a very awsome texture for my sun. http://psd.tutsplus.com/tutorials/painting/red-giant-star-photoshop/. Any one have a recomdendations i can do in unity to help with the realisticness of it?
Answer by Griffo · Oct 12, 2012 at 03:59 PM
Looks awsome. Unfortuantly currently I cant afford to pay for anything I verly have enough gass money to go to college atm.
O$$anonymous$$, you could make you own by texture mapping a ball with a photo from here http://umbra.nascom.nasa.gov/images/ in blender thats free ..
If you used a few images you could animate the texture to make the sun spots look like they are moving and slowly rotate the ball, that would look good.
Ok thanks I will have to google how to animate a texture never done that yet lol. Only characters at this point. Thanks for all your help.
Answer by Griffo · Oct 12, 2012 at 04:14 PM
Make a 1024 x 1024 slightly different texture made up of 9 images 3 x 3 .. or more if you want, then use this script to animate them ..
#pragma strict
var uvAnimationTileX = 3; //Here you can place the number of columns of your sheet.
var uvAnimationTileY = 3; //Here you can place the number of rows of your sheet.
var framesPerSecond = 10.0;
function Update () {
// Calculate index
var index : int = Time.time * framesPerSecond;
// repeat when exhausting all frames
index = index % (uvAnimationTileX * uvAnimationTileY);
// Size of every tile
var size = Vector2 (1.0 / uvAnimationTileX, 1.0 / uvAnimationTileY);
// split into horizontal and vertical index
var uIndex = index % uvAnimationTileX;
var vIndex = index / uvAnimationTileX;
// build offset
// v coordinate is the bottom of the image in opengl so we need to invert.
var offset = Vector2 (uIndex * size.x, 1.0 - size.y - vIndex * size.y);
renderer.material.SetTextureOffset ("_MainTex", offset);
renderer.material.SetTextureScale ("_MainTex", size);
}
No problem, by the way that sun texture is only $5 http://activeden.net/item/sun-prefab/628536 but I agree about money being tight, and I enjoy doing a lot of it myself if I can.
Your answer
Follow this Question
Related Questions
Procedural Generation 1 Answer
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How do I paint the part of a model that is embedded in another model?, 0 Answers
How to render a RenderTexture into a specific mipLevel 0 Answers