Logo by chaos_crystal - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. April 26, 2024, 11:57:15 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: 1 2 3 [4] 5   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Advanced Terrain Generator  (Read 25823 times)
0 Members and 6 Guests are viewing this topic.
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #45 on: November 20, 2015, 03:44:52 PM »

@Crist-JRoger I agree, most people will not be able to use the full script. sad
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #46 on: November 20, 2015, 10:37:43 PM »

I've split the complex stuff into multiple smaller generator components, so people with weaker GPUs could run it.
I'm on Synthclipse now, so I'd need to convert it back to frag standard.

Anyways, today I implemented also a terrain based on domain warp noise.
It's still pretty fast and results are decent.

Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #47 on: November 20, 2015, 11:15:52 PM »

Here's the stripped down and modular version of the TG 3.3.

* TG_3-3.rar (194.94 KB - downloaded 283 times.)
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #48 on: November 21, 2015, 01:17:31 AM »

Looks great! You latest frag (TG 3.3) works fine on my machine.
Logged
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #49 on: November 21, 2015, 04:10:26 AM »

Awesome... will be testing TG 3.3 tonight wink TY!
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #50 on: November 21, 2015, 09:29:30 AM »

Default set of frags works well! Thank you. But when i uncommented #include "DEF-Terrain_IQT.frag" and compiled script, i get the same error, again. My videocard is not weak, because for example i played in Witcher3 on high graphic options and it was very fast  smiley

Log (not full)
Code:
Could not link shaders: Fragment info
-------------
0(712) : warning C7011: implicit cast from "int" to "float"
0(716) : warning C7011: implicit cast from "int" to "float"
0(742) : warning C7011: implicit cast from "int" to "float"
0(750) : warning C7011: implicit cast from "int" to "float"
0(986) : warning C7011: implicit cast from "int" to "float"
0(991) : warning C7011: implicit cast from "int" to "float"
0(1267) : warning C7011: implicit cast from "int" to "float"
Internal error: assembly compile error for fragment shader at offset 403840:
-- error message --
line 15745, column 1:  error: too many instructions
-- internal assembly text --
!!NVfp5.0
OPTION NV_gpu_program_fp64;
OPTION NV_bindless_texture;
# cgc version 3.4.0001, build date May 11 2015
# command line args:
#vendor NVIDIA Corporation
#version 3.4.0.1
#profile gp5fp
#program main
#semantic EquiRectangular
#semantic subframe
#semantic backbuffer
#semantic FocalPlane
#semantic Aperture
#semantic Gamma
#semantic ToneMapping
#semantic Exposure
#semantic Brightness
#semantic Contrast
#semantic Saturation
#semantic GaussianWeight
#semantic AntiAliasScale
#semantic FOV
#semantic Detail
#semantic DetailAO
#semantic FudgeFactor
#semantic MaxRaySteps
#semantic Dither
#semantic AO
#semantic Specular
#semantic SpecularExp
#semantic SpecularMax
#semantic SpotLight
#semantic SpotLightDir
#semantic CamLight
#semantic CamLightMin
#semantic Glow
#semantic GlowMax
#semantic Fog
#semantic HardShadow
#semantic ShadowSoft
#semantic QualityShadows
#semantic BaseColor
#semantic OrbitStrength
#semantic X
#semantic Y
#semantic Z
#semantic R
#semantic BackgroundColor
#semantic GradientBackground
#semantic CycleColors
#semantic Cycles
#semantic FloorNormal
#semantic FloorHeight
#semantic FloorColor
#semantic sTranslate
#semantic sRotate
#semantic sScale
#semantic sTwist
#semantic clipToBox
#semantic showClippingBox
#semantic cBoxSize
#semantic cBoxTranslate
#semantic cBoxRotate
#semantic TerSinNoisePrimFreq
#semantic TerSinNoisePrimAmp
#semantic TerSinNoisePrimOffset
#semantic TerSinNoiseSecFreq
#semantic TerSinNoiseSecAmp
#semantic TerSinNoiseSecFM
#semantic TerSinNoiseSecAM
#semantic TerSin1Out
#semantic TerSin2Out
#semantic TerIQIterations
#semantic TerIQInitFreq
#semantic TerIQInitAmp
#semantic TerIQFreqMul
#semantic TerIQAmpMul
#semantic TerIQOffset
#semantic TerIQAmpGain
#semantic TerIQ2DOut
#semantic TerIQ3DOut
#semantic TerIQMixBalance
#semantic TerIQMixOut
#semantic TerDWIterations
#semantic TerDWwf
#semantic TerDWwa
#semantic TerDWFreq0
#semantic TerDWAmp0
#semantic TerDWAmp
#semantic TerDWFreqMul
#semantic TerDWAmpMul
#semantic TerDWOffset
#semantic TerDWNoiseOut
#semantic TerFastMode
#semantic TerOutput
#semantic TerPTRotate
#semantic TerPTTranslate
#semantic TerPTScale
#semantic TG1_Mode
#semantic TG2_Mode
#semantic TG3_Mode
#semantic TG1_Center
#semantic TG2_Center
#semantic TG3_Center
#semantic TG1_Size
#semantic TG2_Size
#semantic TG3_Size
#semantic TG1_Shape
#semantic TG2_Shape
#semantic TG3_Shape
#semantic TGLevOut
#var float4 gl_FragColor : $vout.COLOR : COL0[0] : -1 : 1
#var float gl_FragDepth : $vout.DEPR : DEPR : -1 : 1
ENDIF;
ENDIF;
ENDIF;
IF    NE.x;
MOV.F R15.w, R16.x;
.................................
END
# 15645 instructions, 37 R-regs, 1 D-regs
Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #51 on: November 21, 2015, 08:03:41 PM »

-- error message --
line 15745, column 1:  error: too many instructions

too much code  sad
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #52 on: November 22, 2015, 06:18:41 AM »

TG 3.3 works well and, I think, warrants further development/refinement.

Currently Fragmentarium takes the user source with all included files and makes a single vertex/fragment shader for DE, maybe we are seeing the limits of a single shader doing all of the work, I think eventually it will have to be split into, object(xyz surface), lighting(ambient directional point source), shadow(hard soft), color? in such a way that each successive shader uses the data from the previous, like object(s) first for depth values, light second for surface normals, then shadows for intensity mask, and finally color derived from the data generated by these passes. Just need to break it down and figure out how to work it into a "shader swapping" version of Fragmentarium cheesy so added objects or effects are relatively contained to one vertex/fragment shader and executed as needed.

The BufferShader.frag is a good place to start as it already gets used like this, it's a separate shader that draws the rendered image on a quad with some "Post" image processing, I think maybe some stuff could be moved out of DE.frag and into BufferShader.frag.

For instance TG 3.3's DE shader is about 13767 lines of GPU assembler (on my GTX760) and TG 3.3's buffer shader is 208 lines, this tells me that there is a lot of room in buffershader.frag that could be used for calculating shadows from light and depth information generated in DE.frag, maybe some of the oh so elusive fragment shader wizards are looking at this already wink with maybe a geometry shader or 2 thrown in just for fun...

hmm... this is my Christmas wish  nerd Sceptical
« Last Edit: November 22, 2015, 06:25:06 AM by 3dickulus » Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #53 on: November 22, 2015, 02:58:14 PM »

3dickulus, that sounds good.
I understand capacity of single shader is becoming a bottleneck.
However, I am not sure how would it work performance-wise. Would it be beneficial to have tasks spread into various shaders?

I am a total newbie to understanding how GPUs and shaders work on a deeper level, however, I assume that given I have 3K shader cores, they just process 3K frags/pixels at once in parallel. Right? So if we had 2 shaders (running in parallel) they would be simply spread across avail cores, so not much gain on the performance?

I can see multi-shaders beneficial at various levels.

1 - Procedural textures for materials and displacement
2 - materials
3 - post effects

and probably even more.
Also, having a few outputs per shader (or on multiple shaders but within the same let's say 'project' would be beneficial as we could render various layers like depth,  alpha, AO, lights, shadows etc… and output to multiple files (or multi-layer EXR) for further compositing. That would be powerful not only for my personal use, but also for VFX industry.

I would suggest considering a node-based approach for handling projects and shaders relationships.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #54 on: November 22, 2015, 03:53:47 PM »

on my GTX760 the hardware is setup like this...

( 6) Multiprocessors x (192) CUDA Cores/MP:          1152 CUDA Cores
Warp size:                                                                 32
Maximum number of threads per multiprocessor:  2048
Maximum number of threads per block:                 1024
Maximum sizes of each dimension of a block:        1024 x 1024 x 64
Concurrent copy and kernel execution:                   Yes

figuring out how many threads a shader might use is difficult because it is dependant on the data layout and instruction flow, GPUs are not good at boolean conditionals like if-then-else or iterative functions like mandelbrot, fortunately the voodoo is done for us and all we have to do is work within the constrains of the pipeline and GLSL.

if something can be moved from the DE shader into the buffer shader then the performance hit will be 0, it will execute at the same speed as it does now, maybe faster due to some room for the GPU compiler to optimize better, as long as you don't add anything, when the new space in DE is then filled by more features or processing there will be an obvious performance hit.
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #55 on: December 14, 2015, 09:46:19 PM »

Patryk`s iq-noise and heightmap from M Benesi

Logged

cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #56 on: December 15, 2015, 01:33:42 AM »

these non-heightmaps but noise fields make excellent landscapes, has anybody information on algorithms that apply erosion effects on such a structure?
Logged

---

divide and conquer - iterate and rule - chaos is No random!
Patryk Kizny
Global Moderator
Fractal Fertilizer
******
Posts: 372



kizny
WWW
« Reply #57 on: December 15, 2015, 07:41:20 PM »

these non-heightmaps but noise fields make excellent landscapes, has anybody information on algorithms that apply erosion effects on such a structure?

Modelling these realistically could be difficult and IMHO not worth it.
BUT you can easily mimic that and I did it with higher frequency sin noise applied. See my previous imagery in this thread.
Logged

Visual Artist, Director & Cinematographer specialized in emerging imaging techniques.
laser blaster
Iterator
*
Posts: 178


« Reply #58 on: February 05, 2016, 09:45:36 PM »

Wow, some cool-looking pics in this thread! Funny that I also happened to be working on terrain .frag when I found this. Although I'm using 2D instead of 3D noise. I find that 2D Perlin noise, when modulated and combined in a certain way, gives great-looking mountains (pictures attached). The black and white picture is colored using one of the second order partial derivatives of the landscape surface. It highlights the ridges nicely.

Modelling these realistically could be difficult and IMHO not worth it.
BUT you can easily mimic that and I did it with higher frequency sin noise applied. See my previous imagery in this thread.
I've been trying to tackle just that problem. Specifically fluvial erosion, like this: http://www.nordiclandscapes.com/Mountains-Volcanic-landscapes-II/slides/mountain-erosion-vegetation.jpg. Of course there are simulation-based methods that run on a grid, but those would be inconvenient to do in Fragmentarium, and they're not fractal-based.

I found a neat trick for creating pseudo-erosion effects here: http://www.decarpentier.nl/scape-procedural-extensions, which I implemented in my terrain. But I also have a new method in the works.

My terrain implementation is very similar to his "swiss turbulence" example, with a few differences. He used the classic "ridged multifractal" approach to terrain, where you take the absolute value of each octave of Perlin noise to create sharp ridges, and then modulate the strength of each octave based on the sum of the previous octaves, to basically flatten out low regions of the map creating flat basins between the ridges. What I do differently is, for each octave I generate two different Perlin noise samples, take their absolute values, then multiply them together. This emphasizes individual peaks more, whereas his method tends to create longer ridges. Also, instead of just taking the absolute value, I use a "smooth abs" function that doesn't create such a hard crease, and is parametrized by a smoothness value. The function looks similar to this: http://amath.colorado.edu/faculty/becker/Dual_vs_Primal_smoothing.png

Another difference is that I modulate the strength of the noise not only on the height, but also on the cumulative derivative of the previous octaves, which smooths out any non-sloped region, whether high or low.

Another difference is that he forgot to multiply the derivative of each octave by it's frequency (which may have been intentional). I added that in. However, doing so can make the terrain look too messy, so I scale down the contribution of higher octaves by their own multiplier.

The last difference is that I use an additional sample of very low-frequency noise to modulate the height of the mountains, this creates large flat regions in the terrain and makes it look more believable.


* Terrain1.jpg (121.85 KB, 1120x720 - viewed 713 times.)
Logged
laser blaster
Iterator
*
Posts: 178


« Reply #59 on: February 05, 2016, 09:47:43 PM »

Here's the black-and-white one colored using the second derivatives that I mentioned before:


Another pic:


* Terrain2.jpg (200.75 KB, 1333x900 - viewed 874 times.)
Logged
Pages: 1 2 3 [4] 5   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Working on more advanced exponent smoothing UltraFractal Alef 2 6433 Last post July 18, 2012, 04:27:46 PM
by Alef
Fractal Terrain Movies Showcase (Rate My Movie) DaveH 10 3153 Last post June 18, 2013, 10:29:16 PM
by DaveH
advanced geometry Fractal Humor taurus 2 3112 Last post August 15, 2013, 12:56:31 AM
by Rodak
Advanced DoF/bokeh-like-effects in JWildfire 2.1 JWildfire thargor6 5 6375 Last post November 22, 2015, 02:51:13 PM
by Patryk Kizny
Advanced Teleportation Machine Mandelbulb3D Gallery Weber 0 1462 Last post August 08, 2016, 10:02:27 PM
by Weber

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.244 seconds with 28 queries. (Pretty URLs adds 0.019s, 2q)