Pranav Sathy Posted March 25, 2016 Author Share Posted March 25, 2016 I have updated the repository to use Typescript , did a few changes to the layout, and also successfully UV unwrapped the sphere and textured it . It uses a Miller Sphere Projection, normalized and converted to UV coordinates (nothing fancy). I am working on procedural terrain generation now, which I can then use to deform the mesh as a heightmap. The stretch goal here is procedurally generate a diffuse texture as well. Screens to come soon (once I get continents working)... but school is a huge hamper GameMonetize 1 Quote Link to comment Share on other sites More sharing options...
Pranav Sathy Posted April 4, 2016 Author Share Posted April 4, 2016 Alright, update for the week guys! I have finished the Continent generation utilizing Simplex noise and some fine tuning. What is even better is after some research I got the procedural terrain to be tileable (which is important for my sphere since we want continuous, natural looking continents). It has turned out really nice so far, and with a little bit more work it will truly be amazing . As usual, here is a screenshot that shows a debug pane with the procedurally generated texture. The TODO now is: Deform the mesh vertices based on the Greyscale heightmap so that we have some more natural looking landmasses. Improve coloring algorithm so it is not just a binary (land / water). Furthermore, seed varying biomes and propagate appropriate coloring. *Thought*: Create a new sphere, scale it to the same size as the existing one pre-deformation, and add a water shader to have real ocean? Rivers... they need to happen lol. Add some kind of nice, subtle space-like scene skybox/coloring. UPDATE: Added a new heightmap debug pane, and *gradient based rendering*. This let me dynamically and quickly create nearly infinite coloring schemes for my planets, by just adding a 0 to [heightmap max] scale gradient of colors. Below is the updated screen shot: adam 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 5, 2016 Share Posted April 5, 2016 Excellent! Pranav Sathy 1 Quote Link to comment Share on other sites More sharing options...
eboo Posted April 6, 2016 Share Posted April 6, 2016 ouch how is fps? Quote Link to comment Share on other sites More sharing options...
Pranav Sathy Posted April 7, 2016 Author Share Posted April 7, 2016 12 hours ago, eboo said: ouch how is fps? It seems to be running at a solid 50 fps, I suppose it could be better however I am not entirely sure how to make it higher o.0. Right now I am trying to get some form of thin plate interpolation working in Javascript, I tried to import the npm module "thinplate" but LAPACK (linear algebra processor) is not available on the browser. I want to utilize to create n-dimension gradients for coloring realistic planets. It is quickly seeming like that might not be a reality however. I intended to use it for more varying biomes (jungles, tundra, desert, etc.). If anyone is free to work on improving the FPS or tips or tricks to do so, perhaps offset stuff to the GPU, that would be super awesome! Thanks! Hope to keep everyone updated shortly. Quote Link to comment Share on other sites More sharing options...
eboo Posted April 7, 2016 Share Posted April 7, 2016 i can spend few time on it. and try to expand it with LOD levels, have you a playground updated?. Quote Link to comment Share on other sites More sharing options...
Pranav Sathy Posted April 7, 2016 Author Share Posted April 7, 2016 7 hours ago, eboo said: i can spend few time on it. and try to expand it with LOD levels, have you a playground updated?. No not yet, I converted everything to TypeScript awhile ago, and it relies on several files (it would not be a simple playground). I would suggest cloning the repo, installing `npm` and `typescript`, and just compiling and running the code. Sorry :/ Quote Link to comment Share on other sites More sharing options...
Pranav Sathy Posted April 9, 2016 Author Share Posted April 9, 2016 Hi Everyone, Here is this weeks update! I got biomes working and refactored the whole code to make it a lot more modular and clear where procedural generation is taking place and what it is being used for (i.e inside the terrain folder). It is not flawless, and if anyone can suggest improvements, it would be much appreciated. So let me take you through the process... first thing first, I had to square away coloring. So the first step was taking a Whittaker diagram (http://w3.marietta.edu/~biol/biomes/biome_main.htm) and translated it into a 2D gradient utilizing Bilinear Interpolation. This allowed me to quickly grab a color based on temperature and rain data that I could generate. Below is a screen of the rendered Whittaker gradient. Once this gradient was finished, it was time to start the easier of the next 2 tasks, temperature gradients. I decided to take a fairly traditional approach to this, and made it a very simple temperature band going from -10 degrees Celsius at the poles to 40 degrees Celsius at the equator. In order to give it a more organic feel, I actually utilized Simplex Noise for distortion. Here is a screen of the temperature gradient with a distortion of maximum of 40 degrees Celsius. Here is where I kind of got lazy, I couldn't really get a rainmap based on the heightmap no matter how much it tried it just ended up looking bad. The idea was to capture the "Orographic Effect", which is the notion that there are dry zones due to the effects of high elevation and wind direction. I decided to just go with the Simplex Noise again and just lowered the frequency to have more contiguous areas. It is kinda bleh, but here is a sample rainmap: So here is where it got interested, the coloring looked nice on land, but the beaches from the previous update looked 'bleh' when blended into the various biomes, especially in the polar region. So I did some extra logic to begin interpolation along the coast line from the 1D calculated color (pure height map) to the 2D calculated color (Whittaker biome), which resulted in a much more natural looking coastal line for each biome. Furthermore, I took the inverse of the heightmap and multiplied it to the rainmap to represent the notion that coastal areas (or areas near water) generally receive more rain. Interestingly enough, if I scaled the normalized heightmap before using to adjust the rainmap, I could artificially decide whether jungles / temperate zones / deserts dominated the map. I called this the "PARCHMENT FACTOR". Finally, to make mountains look better I interpolated their bases into the surrounding biome, and to add a further touch, I interpolated from dirty colored mountain bases to rocky mountain bases the colder the temperate got. I hope this all made sense, but here are the final two screens: I would like to think it is coming along rather well, the potential improvements to be made on this update are the following: The poles are a little messed up, the normals cause the tiles to jump a little. The rain map eventually has to be made more organic, I would prefer not Noise, but rather a calculated gradient based on elevation and temperature. I should make all the procedural terrain generation kind of classes into subclasses of a MapData super class, since they all seem to share common characteristics. Tell me what you think! - Pranav Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted April 10, 2016 Share Posted April 10, 2016 This is really beautiful. Can't wait to see it live:) Pranav Sathy 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.