Shaders, now even programmers can make some lookable graphics

whooohooo, got my very first not that bad looking shader working. It is fairly slow due the overuse of noise3d and noise4d and the lac of alternatives, but at least i got a planet and a few clouds :slight_smile:



http://www.youtube.com/watch?v=kQDGsu1XIZI



Now i have planets, a working server backend including load balancing (i hope that it balances more than it generates overhead) so all left to do is to program a game. Should only take a year or so. :)
2 Likes

Cool, congrats :slight_smile:

Looks like the implementation I pasted here not too long ago. Are you using it? (The 3D and 4D noises for the clouds)

Noise3d is uses for the terrain to texture and sculp the valley’s. and noise4d for the clouds.

All in all 3times snoise() for each vert, 5 times for each pixel for the terrain (noise3d) and 3 times noises4d for each cloud pixel.



The big downside is that the terrain basically would not require to be recalculated since it is static, but i have not yet found a way to generate a noise texture, or store the results somewhere. (Well i guess thats not even possible)



add: i am using the noise functions from here: Home · ashima/webgl-noise Wiki · GitHub

@zzuegg said:
The big downside is that the terrain basically would not require to be recalculated since it is static, but i have not yet found a way to generate a noise texture, or store the results somewhere. (Well i guess thats not even possible)

:? texture maps are about the most standard variable type..? All the water etc. shaders use a small noise texture.

Sorry, maybe i was not explaining clearly, i managed to generate and process a noise texture, but they all did not look good when applyed to a sphere. The seam was always clearly visible and the poles did look washed out.

Ah. Still you can maybe work around that issue with a tiling texture?

You should take a look at the frag/vert I posted. There are no seams and it displays fine.



There is a bug somewhere in my vert though, I haven’t taken the time to hunt it down yet, but except for that it renders perfectly. The bug would be quite awkward to explain in a post, that’s why I’m not going into details right now. I’ll probably post a new video soon and I might make a clip showing that behavior at the same time.

@madjack, did you use a texture in your example? If i used the noise in the shader then there is no seam visible. But dooing those calculations in the shader for static objects is kind of unneeded

I use noise only that I color (tint) based on a lookup texture map which is based on the type of planet (gas giant, rocky, etc).



It might be unneeded in your implementation, but it’s not in mine since all planets are procedurally made at galaxy generation and I don’t want two planets to be the same (visually). That’s why I had to resort to LUT. There’s still some heavy tweaking to do but the results so far are pretty good (most of the time ;)).

Ok, i have made some progress in this. I have modifierd the NeoMaterial engine to give me access to its nodes from code. Now i can procedually generate seamless textures (by changing the planet parameters in the code) and modifying the general system by using the NeoTextureEditor.

Pretty nice thing.



Currently there are two downsides which i was not able to solve.

a) I needed to introduce poles, since texturing on the poles misses it’s goal. Not a big drawback, since poles look quite good.

b) normal mapping on the poles even fails with a zero’ed normal map there is always a ‘hole’ visible at the pole. Not yet sure why and how to solve it.



No normal vs. normal mapped. (Notice the issue on the pole)



http://imgur.com/wfvpY



generated normal map:



http://imgur.com/iKe6w



Performance is awesome, still getting 900fps on fullhd with a 2048x2048 texture size, however, the creation of the texture takes a bit.

@zzuegg I would like to be a little off here. Speaking of NeoTexture have you ever faced this issue?

@iamcreasy said:
@zzuegg I would like to be a little off here. Speaking of NeoTexture have you ever faced this issue?


I do not use tiling, however i have noticed a seam on my planets when using low detail textures, increasing the texture size reduced the seam to a non visible factor.

BTW, same system rendering a procedual generated moon. Moon has not as much settings as a planet, only the cound of the big and small impacts as well as the overall material color.

http://i.imgur.com/GkfBh.png
4 Likes