Giter Club home page Giter Club logo

terrasphere's Introduction

Terrashere

A Zen Planet Painter

Terrasphere is an atmospheric toy/tech demo. 3D Paint the land masses onto your tiny world and chill out to a Trance beat while admiring the beauty of your creation and the infinite space beyond!

Terraspshere was made in 48 hours for Ludum Dare!

Controls

Left Click: Use Active Tool Number Keys: Select Tool (or click the hot bar) Middle Mouse/Right Click: Rotate Camera Mouse Scroll Wheel: Zoom In/Out

Links

Notes

The code is pretty much throwaway garabge. That said, there are a few interesting things worth looking at (despite the fact that they are buried in the heaping pile of garbage).

I wanted to have completely seamless heightmaps projected onto a sphere. I did this setup involving multiple RenderTextures and capturing them into a Cubemap. This gave me height to offset verts (with tex2Dlod) and a value I could feed into a LUT to color the terrain. And then I did something heinous/interesting...

To get the appearance of a normal map out of the sphere-cubemap-heightmap, I took several samples from the cube to deterimine the rate of change across the height, and just sort of... added this to the normalized object space point to get what looks pretty much like an object space normal. By transforming the light and view directions into object space, I could do a rough but passable light and fernsel on my planets surface without having precalculated normals.

All that said, if I were to do it again, I would move a bunch of this crap off the GPU and just have a mesh I can mold on the CPU, and find some other way of getting textures/normals onto the surface. At least I might try that approach. This ended up being horribly complicated and definitely incorrect.

But hey, it doesn't look half bad.

terrasphere's People

Contributors

broxxar avatar

Stargazers

NeatWolf avatar  avatar George Ananchenko avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.