RetroEarthDrawer.exe (v2.0)

Poll

Should this be used in Hacker World?

Yes, always on.
Yes, but can be turned off.
Yes, but off by default.
No, don't use it.

Author Topic: RetroEarthDrawer.exe (v2.0)  (Read 1626 times)

So I made a program which draws the Earth.

RetroEarthDrawer.zip (32-Bit Executable)
RetroEarthDrawer Source.zip (C# Source Code)   NOTE: As of v1.4, you must compile in unsafe mode.  Please let me know if there are any instability issues.


You can run the program from the command line to customize exactly what happens.
Here's an example that sets the view over the Americas, during the summer solstice.
RetroEarthDrawer.exe SA -0.7 SI 1.5708 TA -0.7 TD 0 DL 3600

Alternatively, here's the Moon from the one place it doesn't look off.
RetroEarthDrawer.exe TEX Moon NOLFO TA 0.5 SA 0.5 DPY 30 AT 0

SA: Sun angle.  Controls where the sun is when the program starts.
SI: Sun inclination.  0: Spring equinox; 1.5708: Summer solstice; 3.1415: Autumn equinox; 4.7124: Winter solstice.
TA: Texture angle.  Controls the rotation of the planet when the program starts.  Currently the view can't be inclined from the equator.
TD: Texture day.  Controls how many days it takes for the planet to rotate under the view one time.  This is purely visual.  0 = no visual spin.
DPY: Days per year.  Defaults to 365.2421897.  Set to 0.1 for fun.
DL: Day length, in seconds.  Controls how long it takes for one day to progress.
AT: Axial tilt, in degrees.  Default is 22.5.
RES: Resolution.  Should be Low, Med, High, HD, or XHD.
TEX: The sphere texture.  Use "moon" for the Moon.  Note that the Moon will look weird except from very specific angles.
NOLFO: Turns off light falloff at the edges of the planet.
X#: The scalar for the image.  Defaults to 3.  Must be an integer between 1 and 4.
RT: Real-time.  Not sure if this works properly, so please make sure that it actually shows up as the correct time of day where you are, and post your results here.
CITY: City lights.  Lights appear on the night side of the planet.

The various Spheremap X.png and Spherepos X.png images are rendering masks - if you want to change how retro the Earth looks, copy two matching files and rename them to Spheremap.png and Spherepos.png.  At some point I'll probably make that a command line option too.  Use the RES console flag to change this without having to rename the files.


I'm genuinely not sure if there's a better way to do rendering of this nature.  There probably is, but I don't know what it is.


Update v1.1: Made the Earth bigger so that it's less difficult to see; default resolution is now High instead of Med; added HD rendering mask.
Update v1.2: View rotation now defaults to off; added DPY console flag.
Update v1.3: Fixed the Earth rotating the wrong way (d'oh!); added AT console flag; added RES console flag; added experimental RT console flag.
Update v1.4: Added XHD rendering mask; added CITY console flag; the RT flag should now sync with the computer's datetime properly; made rendering faster.
Update v1.5: Added TEX console flag; added moon texture; added NOLFO console flag; added X# console flag; default scalar is now X3; fixed texture rotation being in the wrong direction.
    Update v1.5.1: Fixed always using the Moon texture (d'oh!).
    Update v1.5.2: Tweaked the day offset for the realtime mode.
    Update v1.5.3: Removed debug code to always set realtime to true (d'oh! I should stop coding tired).
Update v1.6: Fixed NOLFO flag; fixed X# antialiasing being off-center; fixed mask position mistakes.

Update v2.0: Added a GUI for the options; optimized performance.
« Last Edit: September 30, 2014, 02:37:55 AM by Xalos »



that looks..... cool?

no offense but is it jpg'd for a reason?


that looks like windows 95 era clip-art


Just to be clear, it's not a static image.  It draws an animated image of the Earth in a retro style.

EDIT: Here's a picture of the Earth in full daytime, in its full 128px glory!
« Last Edit: September 29, 2014, 07:13:00 AM by Xalos »

PoE? (Purpose of Existance?)


I was messing around in Maya and I made this.



I noticed your diffuse texture is MUCH higher res than everything else. Why not scale up everything to match the higher res?

Still, your thing is kinda cool that it rotates and does lighting.

I noticed your diffuse texture is MUCH higher res than everything else. Why not scale up everything to match the higher res?

The texture map is the only thing that actually corresponds to the real-world surface of the Earth.  The other images correspond to how the surface should be mapped on the screen itself.  Since the point is for it to be retro (low-res), scaling them up much further would defeat the purpose.

What's going on here? :)

The program now technically supports arbitrary sizes of spherepos maps.  The problem now is that it becomes prohibitively slow at the 256x256 mark.