• Advertisement

Ryokeen

Member
  • Content count

    33
  • Joined

  • Last visited

Community Reputation

849 Good

About Ryokeen

  • Rank
    Member

Personal Information

  • Interests
    DevOps
    Education
    Programming
  1. 3D UV map blocky voxel models

    What comes to my mind is the following: http://vcg.isti.cnr.it/volume-encoded-uv-maps/ I've not rly looked into it myself but from a quick glimpse it might be something
  2. @ChenA I'm not sure how they even got the shape working. I get at best some very diffuse unshapeable cloud areas with their Remap approach. That's why i'm still sticking to my own way. For the top view, i have to change the shader a bit for that to work, since i optimized the cloud layer to be always above the camera. Makes more sense in Earth Special Forces (players there don't get that high). Will do that when i have time on weekend
  3. With the height from the weatherdata i compute the fade_in/fade_out values very similiar to how they do it in the article.   Then somewhere i have lCoverage = 1.0-cloudType.r*fade_out*fade_in; Where clodeType is the weatherdata at the current sample position. Try just the same you did for the cloudtops at a smaller heightscale for the bottom, that should help a lot. Also i scale the final cloud value by fade_in to make it a bit smoother
  4. Yep it is expensive, around 1.4-2.1ms on a gtx970 @1/16th FullHD resolution. Optimisations so far, early out on high opacity, no expensive calclation on coverage  == 0 , and no full quality light-samples on opacity > 60% and a carefully tweaked scale. Thought on a signed distance field aswell, but that eliminates the nice property of realtime coverage/shape changes
  5. Whups, typo there base_cloud = base_cloud - high_freq_noise*(1.0-base_cloud); and coverage = 1.0-coverage*height_fade; //from 1 where the fadeout starts to 0 where it ends I invert the coverage because want remaining "vapor bubbles" as the cloud source
  6. Thx for the project. Yeah the formular is just try and error.  The idea was to think of the base noise as a form of heat/cloud bubbles. Then apply some threshold(the coverage) to it. Rescale it to 0..1 range with a steep slope. Invert it and use that as a final coveragemask. Then simply some CSG to build the final cloud volume.
  7. Thank you, that would be nice.
  8. rgba8 should be enough precision. After all it's just a simple density value. For the base detail, you can play araound with the scaling. My clouds start at around 1,8km in height and have a scaling of 68m per texel. The detail noise got a 16 times higher scaling. For remapping i use a weird calculation. float4 noise = tex3Dlod(WorleyCloud,float4(pos,0.0)); float mask = (noise.r*0.6+noise.g*0.8+noise.b+noise.a*0.6)/3.0; float denom = 1.0/(coverage*0.25+0.0001); float lcov = 1.0-saturate((mask - coverage)*denom); float4 n = saturate((noise-lcov)/(1.0001-lcov)); float cloud = saturate(max(n.x*1.1,max(n.y*1.14,max(n.z*1.13,n.w*1.12)))); That's what i use to sample the volume texture   Btw @ChenA where did you find a tiling 3D perlin noise ?
  9. From my experiments the way you combine the base noise octaves have the most impact on how detailed the clouds are. But well i'm not using perlin-worley , just worley noise with 3 octaves per channel with a size of 123^3.   So the way i combine them is totally different from what they do, some kind of fbm+inbetween remapping with coverage. And ofc the powder effect adds a lot.   For the cloud top, think the main difference is, i don't modify the density of the clouds with the height signal, but modify the coverage. Then sure, the smaller high frequency noise adds the very fine detail and is applied like that base_cloud = base_cloud * high_freq_noise *(1.0-base_cloud); You see i simply assume that an edge is where the cloud got a density below 1
  10. Excactly, along with some code to make it look as needed. Also notice i only use coverage and coudtype(rg) as i don't need that fine control, but still want a "random" look all over the map
  11. For mapping the weather texture i use as simple planar projektion, or more xy position of the samplepos with some scaling and wind offset. Works quite well as long as the curvature of you cloudsphere is small. As i said i use a ray-sphere intersection as the starting point, but with a quite big sphere wich is centered in xy at the camera's position and at a height so that above the cam the clouds start at the height you want.   For the weathertexture what you can try out, is using 2 premade tiling perlin noise textures(different noise in r,g,b,a) , scroll them, combine them and in my case apply a global coverage value to it(remapping with some exp magic). It gives changing patterns , you have a global coverage value and as a result also local covarage values.   float t = 255.0-min(255.0,(inCoverage*255.0));//inCoverage is a global coverage value float c = max(0.0,cloud_sampled*255.0-t);//some remapping i found somewhere years ago float cld_cov = 1.0-saturate(pow(0.99325,c));//exponent contolls sharpness of the result(higher, more soft) That's what i use to remap the combines perlin noises to build a cheap but animated weathertexture     Right Top image shows the weather texture. As you see it's quite simple but works.   For a more realistic outcome it could also be possible to use some texture just as a "heat and vapor" source and let a cellular automata evolve some nice shapes out of it. But yeah as a start, don't worry too much about the weather texture as simple perlin noise textures work good for a beginning.
  12. i kind of coded clouds similar to theirs(well based on their noise texture ideas), so the mapping is done by raymarching through the 3d noise texture and doing the density, coverage,refinement and lighting on each of the raymarch sample. You can start raymarching by intersecting a lower cloud "plane" with the eye-vector at a pixel, then you march in steps and do your calculations. Later on you can do an intersection with a sphere around your map so you get a nice curvature at the horizon. So reading up on raymarching and volume rendering is a good idea.   About how one could generate the weather texture, that's something i need ideas for aswell. You could precompute/prepaint some weather textures for a single cloud. Then based on the weather you want, pack some of the premade textures in a fbo, add some magic and use that in the final raymarch shader.   The cloud shape depends a lot on the baked 3D noise texture and how you combine it later on. I mean you have 4 channels with different octaves and only need a float density value. For me it was a lot of experimenting.
  13. From what i remember at least some of those blending functions assume Z to point upwards, means they work in tangentspace. So they blend normalmaps, not normals. Also i don't get why you want to blend the mesh normal with a normalmap converted to worldspace via TBN since the TBN orients tangentspace-normalmaps to your mesh. To me it looks like you get kind of double oriented normals.   I used the partial derivate function to add some additional detail, but i blended it in tangentspace and then converted the resulting normal to worldspace via TBN.
  14. Uhm am i wrong or might it just be the high amount of BufferBinds(both) ? Would be way better to pack stuff into bigger vao's and use an offset in glDrawElements
  15. Buuut it should work for sun color aswell :D What i've done in the past was(used gpu Gems2 approach) use mie coefficents(the 1/wavelength^4 was rayleigh i think) and some sort of mie phase function and averaged some rays around the sunlight direction. Worked okayish and the blue tone was only noticeable on the clouds. Other than that, depending on how realistic it should be, you could compute it for a ray towards the sun and desaturate it based dot(sundir,up) with some smoothstep function.
  • Advertisement