onceadrog / lagrange

A space game
MIT License
1 stars 1 forks source link

Earth shadow rendering requires a 90MB file #4

Open onceadrog opened 6 years ago

onceadrog commented 6 years ago

Currently the Earth sprite has 360 frames (for each degree rotation). There must be a better way to apply shadow.

cij11 commented 6 years ago

Proposed solutions.

  1. Ignore this problem for now, don't render a shadow. Heck, Earth can just be a blue-green circle. Early development is about getting to the minimum viable product. You don't want to burn out fixing cosmetic issues before you know the core gameplay is engaging.

  2. Have a (completely lit) earth sprite. On top of that, place a different semicirculular 'shadow' sprite. Rotate the shadow sprite with the sun.

  3. Have one sprite of the earth completely in daytime. Have another of the earth completely at nighttime. For each point on the sprite, calculate a "Percent illuminated" value. Generate a third composite sprite, with a pixel value of (Percent Illuminated Day Sprite) + (1-Percent Illuminated) Night Sprite.

onceadrog commented 6 years ago

My plan is to take it out for now, (and go back to the fully illuminated globe (90KB) but come back to it later with a proper solution.