Planetside Software Forums

General => Terragen Discussion => Topic started by: WAS on November 04, 2015, 02:44:42 PM

Title: Heightfield as Crater Shader
Post by: WAS on November 04, 2015, 02:44:42 PM
Just a simple test using a heightfield for the craters rim shader for some simulation of ejection. It looks alright, but does need a lot more work. It'd probably be better mask out only the cracks to control the rim height a lot easier and use a image map shader.

(http://i.imgur.com/7a3Sv5c.png)

The Node Network

(http://i.imgur.com/QiwtwID.png)

Using a image map instead of a heightfield would probably allow you to pop it into Photoshop and duplicate the layer on Multiply and rotate it to add even more ejection lines. You can see I attempted to duplicate the displacement to use and rotate but the transform input was not working on the captured displacement.

(http://i.imgur.com/qbTAJaX.png)

Also, extracting the lines and getting rid of the sloping would allow  for larger ejection area as seen in the image below

(http://www.astronomycafe.net/qadir/MercuryKuiper.jpg)

Just some testing I've been doing.
Title: Re: Heightfield as Crater Shader
Post by: Oshyan on November 04, 2015, 02:59:41 PM
It's actually a pretty nice effect, better for a weathered crater on Earth than e.g. the moon though. With some different erosion settings you might get finer lines that could be used better for the long radials of ejecta. I also suspect it's possible to create a radial line function that could then be warped to handle this without the dependence on erosion and limited resolution of heightfields...

- Oshyan
Title: Re: Heightfield as Crater Shader
Post by: AP on November 04, 2015, 05:56:41 PM
That looks fairly nice. Now we need to duplicate it all over the surface. I think the rim needs a hard rim for the top mixed with a larger soft rim outward. Maybe the ejecta can be added to a Merge shader using Subtract connected to the soft rim. The blend should allow the impression of a longer ejecta i suspect. Using a Colour adjust shader might help.

Has anyone ever tried a radial line function? I would very much like to see that in action.
Title: Re: Heightfield as Crater Shader
Post by: WAS on November 04, 2015, 06:44:04 PM
It'd be nice to get the erosion effect without the mound, but without a mound, it's hard to erode anything. Little annoying as I favor terragens crater height settings. And yes population is the trick, that's why I wish there was much simple position function (which would make animation that much easier and smoother as apposed to transforming the textures) to pipe in dynamic positions which can also be piped into your SSS masks, etc.
Title: Re: Heightfield as Crater Shader
Post by: AP on November 04, 2015, 07:41:31 PM
What about something called a Shader populator? You define and build a shader in a square area then scatter it much like the current Populator now.
Title: Re: Heightfield as Crater Shader
Post by: Dune on November 05, 2015, 02:20:47 AM
Now that would be a cool addition, a shader populator, even if you would use a simple image map to be spread (and warped/masked) for these ejecta. I believe mogn once made a starburst blue node setup a long time ago, but I can't recall whether that could be randomized.
Title: Re: Heightfield as Crater Shader
Post by: AP on November 05, 2015, 06:37:16 AM
Yes, you can type in the area size you want to capture and scatter it about. The capture area could behave like the Simple shape shader so there are at least simple options to soften the edges, alter the shape, change the capture area location.

In fact, imagine using the captured area being stored in memory and porting it's footprint over the the Painted shader then you can paint the captured Shader information all over your terrain or anything else.
Title: Re: Heightfield as Crater Shader
Post by: billhd on November 05, 2015, 10:35:31 AM
I have yet to get a good way to have radial ejecta patterns procedurally, but can generate a variety of crater types using only the voronoi setting of the PF combined with other PFs.  More efficient than the solitary crater shader (though there are possibilities for multiples of the crater shader using masked arrays). There are many setting combos of voronoi PF that can yield good results.   A couple views attached in the screenshot.  WIPs - for instance I need better-distinguished representations of highland vs. mare.

I use lunar-like settings to expand my grasp of TG (really mostly PF-based), have dabbled with other appearances such as Mars. I had visited Arizona and started trying to reproduce the plants and rocks, decided technique development is easier if I concentrated on mostly b&w rocks and landforms for starters, move to Earth later.  I have a reasonable grasp of getting the surface up close and wound up incrementally working a multi scale model of a moonlike world from two different scales, close up and far away, so I'm converging on the middle now.  I suspect that for Tycho-type rays I will use the heightfield technique.

Looking through the solar system, the work is cut out as many craters are noncircular with rilles, terraces central peaks or craters, rim craters and all manner of blobby and swirly forms. The hard challenge is to reflect the variety of what we see.  Now somebody tell me how an impact makes polygons (take a look at Ceres -http://dawn.jpl.nasa.gov/multimedia/images/image-detail.html?id=PIA19908).
Title: Re: Heightfield as Crater Shader
Post by: WAS on November 05, 2015, 05:49:37 PM
Quote from: billhd on November 05, 2015, 10:35:31 AM
I have yet to get a good way to have radial ejecta patterns procedurally, but can generate a variety of crater types using only the voronoi setting of the PF combined with other PFs.  More efficient than the solitary crater shader (though there are possibilities for multiples of the crater shader using masked arrays). There are many setting combos of voronoi PF that can yield good results.   A couple views attached in the screenshot.  WIPs - for instance I need better-distinguished representations of highland vs. mare.

I use lunar-like settings to expand my grasp of TG (really mostly PF-based), have dabbled with other appearances such as Mars. I had visited Arizona and started trying to reproduce the plants and rocks, decided technique development is easier if I concentrated on mostly b&w rocks and landforms for starters, move to Earth later.  I have a reasonable grasp of getting the surface up close and wound up incrementally working a multi scale model of a moonlike world from two different scales, close up and far away, so I'm converging on the middle now.  I suspect that for Tycho-type rays I will use the heightfield technique.

Looking through the solar system, the work is cut out as many craters are noncircular with rilles, terraces central peaks or craters, rim craters and all manner of blobby and swirly forms. The hard challenge is to reflect the variety of what we see.  Now somebody tell me how an impact makes polygons (take a look at Ceres -http://dawn.jpl.nasa.gov/multimedia/images/image-detail.html?id=PIA19908).

Those are really nice, especially like the second one. And yeah it really is hard to randomize the placement, and design of crator without not coming off unnatural.

Quote from: Oshyan on November 04, 2015, 02:59:41 PM
It's actually a pretty nice effect, better for a weathered crater on Earth than e.g. the moon though. With some different erosion settings you might get finer lines that could be used better for the long radials of ejecta. I also suspect it's possible to create a radial line function that could then be warped to handle this without the dependence on erosion and limited resolution of heightfields...

- Oshyan

It definitely looks better in a earth-type scene.

(http://i.prntscr.com/68f2fe7e94034fc89bb4209b3d90e0e5.png)
Title: Re: Heightfield as Crater Shader
Post by: Matt on November 05, 2015, 09:39:59 PM
There is a Shader Array but it doesn't have any randomisation options yet. Perhaps with enough Shader Arrays you could get the results to appear random enough.

http://planetside.co.uk/wiki/index.php?title=Shader_Array

Matt
Title: Re: Heightfield as Crater Shader
Post by: AP on November 05, 2015, 10:09:49 PM
It looks very nice but yes, the missing ejecta and the largest dark patches could use a bit of warping to break up the smooth circular look.
Title: Re: Heightfield as Crater Shader
Post by: AP on November 05, 2015, 10:23:15 PM
Quote from: Matt on November 05, 2015, 09:39:59 PM
There is a Shader Array but it doesn't have any randomisation options yet. Perhaps with enough Shader Arrays you could get the results to appear random enough.

http://planetside.co.uk/wiki/index.php?title=Shader_Array

Matt

Randomization would be a life saver. It would be too many Shader arrays in this case. It would have been a similar issue when i wanted to duplicate Simple shape shaders. For an older project, it would have taken dozens of them. A huge node mess and rather time consuming.
Title: Re: Heightfield as Crater Shader
Post by: Dune on November 06, 2015, 03:30:00 AM
Maybe if you stack the arrays, the count goes up exponentially. A little large scale warp over it.... but I don't think you can keep the nice round shapes then  :(
Title: Re: Heightfield as Crater Shader
Post by: billhd on November 06, 2015, 10:34:17 AM
Too many shader arrays and masks, and we get slowdown, which is why procedural methods with PF are good.  WAS, that individual crater is looking real good, reminds me of Barringer Crater in AZ. To match your pic (which I think is a crater on Mercury) better, may I suggest increasing the rim setting quite a bit. Also you may consider two crater shaders in the same spot, one for the main crater, matching the main crater size, using its rim setting set just a bit bigger than the crater itself for the very tight local rim; and one shader for the radial ejecta features with a zero height for the crater and small height for the extended ejecta features.  The main crater is terraced, some masked strata PF (try two masked and merged with different settings for strata spacing and plateau buildup) will work for achieving that.   

A thought related to arrays - would it be possible, Planetside, to have arrays that can conform to spheres and cylinders - better yet, arbitrary object surface conformation?  For instance to locate vortex shaders on a squashed sphere to simulate a jovian planet.  And certainly a randomization capability, as Matt mentioned, would be nice.  Something similar to the way Wings3D allows vertex randomization on a mesh.
Title: Re: Heightfield as Crater Shader
Post by: WAS on November 06, 2015, 11:22:22 AM
Yeah, I can't even use one large shader array on 4GB RAM.

I do find it very puzzeling that a shader array at 100x100 will kill TG for me making rocks, but yet a image map creating the same image from a PS image array will work just fine.

I think the Shader Array in general need a lot of work and optimization. For example, combining the whole shader at the end into a simple image map would apparently free up all that slowdown as the same count and size in a image map works fine.
Title: Re: Heightfield as Crater Shader
Post by: fleetwood on November 06, 2015, 01:49:39 PM
Regarding ejection material, this radial pattern by DandelO can be a start.

http://www.planetside.co.uk/forums/index.php/topic,15364.0.html (http://www.planetside.co.uk/forums/index.php/topic,15364.0.html)
Title: Re: Heightfield as Crater Shader
Post by: WAS on November 06, 2015, 09:15:57 PM
Quote from: fleetwood on November 06, 2015, 01:49:39 PM
Regarding ejection material, this radial pattern by DandelO can be a start.

http://www.planetside.co.uk/forums/index.php/topic,15364.0.html (http://www.planetside.co.uk/forums/index.php/topic,15364.0.html)

This guy just crawls out of the rocks somewhere in the forums and just likes points me to the solution to a problem I have had for like 5 years... You sir, are my new hero. I think this may work here as well. Screen grab soon.
Title: Re: Heightfield as Crater Shader
Post by: AP on November 06, 2015, 10:05:18 PM
I'm keeping an eye closely here on this thread.
Title: Re: Heightfield as Crater Shader
Post by: WAS on November 07, 2015, 02:34:48 AM
We definitely seem to be on to something here people. :) The only thing missing is stratification of the mound which I haven't figured out how to do.

(http://i.imgur.com/2vQIURq.png)

(http://i.imgur.com/nOVd3Lt.png)
Title: Re: Heightfield as Crater Shader
Post by: Dune on November 07, 2015, 02:47:26 AM
I remember vaguely this setup works on just one location, but I might be wrong.
Title: Re: Heightfield as Crater Shader
Post by: WAS on November 07, 2015, 03:23:47 AM
Quote from: Dune on November 07, 2015, 02:47:26 AM
I remember vaguely this setup works on just one location, but I might be wrong.

As with the current limitations of TG with no position inputs on shaders. As mentioned before you could use the Transform Input Shader but the results may not be desired. I have yet to try it on this. *Edit* I tried below the crater shader and to no avail that I could tell through the preview (it may not work on the SSS which may need my new coordinates.) Seems everything is position-able but the radial lines.
Title: Re: Heightfield as Crater Shader
Post by: AP on November 07, 2015, 04:32:51 AM
Stratification of the mound can be solved using a Strata and outcrops shader.
Title: Re: Heightfield as Crater Shader
Post by: mogn on November 07, 2015, 06:31:16 AM
You can construct a radial shader in the following way:

measure the angle to the current point: v = Atan2(z, x)
q = PI/18 (10 degrees)
s = modulus(v, q)             create 18 slices of 10 degrees
p = v-s                            the low angle of each slice (N*q)
in this tgc p is used as hue input of a build hsv, and the x and z is prenoised:
X = x + noise(z)
Z = z + noise(x)

If you rotate the xz coordinate system p radians an select one of the slices e.g p = 0
and make a procedural construct contained in that slice, the construct is mirrored
in all the slices.

Title: Re: Heightfield as Crater Shader
Post by: Dune on November 07, 2015, 08:04:13 AM
I was hoping you would chime in, mogn  ;) Is this applicable at different locations, say random, or bound to procedural dots?
Title: Re: Heightfield as Crater Shader
Post by: AP on November 07, 2015, 08:41:15 AM
I'm still investigating function nodes but that one went over my head.
Title: Re: Heightfield as Crater Shader
Post by: mogn on November 07, 2015, 09:10:27 AM
Quote from: Dune on November 07, 2015, 08:04:13 AM
I was hoping you would chime in, mogn  ;) Is this applicable at different locations, say random, or bound to procedural dots?

Just subtract a position vector E.g. [300, 0, 200] from the get vector. This vector can be random.
Title: Re: Heightfield as Crater Shader
Post by: Dune on November 07, 2015, 10:44:00 AM
I understand, but I actually meant if it could be reproduced to more than one location, like a crater field. I guess not. Basically what is needed is random 'dots' to begin with and radiation from those dots.
Title: Re: Heightfield as Crater Shader
Post by: fleetwood on November 07, 2015, 11:44:36 AM
 
With ejection of material it makes more sense to me that the radial pattern used be in the form of a radiating multi pointed star rather than like a slice of  pie , so that you get a ray structure which mimics the amount of material ejected which would tend to be less and as you move away from the impact.

   
Title: Re: Heightfield as Crater Shader
Post by: WAS on November 07, 2015, 12:26:48 PM
Quote from: fleetwood on November 07, 2015, 11:44:36 AM

With ejection of material it makes more sense to me that the radial pattern used be in the form of a radiating multi pointed star rather than like a slice of  pie , so that you get a ray structure which mimics the amount of material ejected which would tend to be less and as you move away from the impact.


Yeah it's definitely in a more ray burst structure. Strata and Outcrops will not work as desired on the mound as it does not create true stratified rock. In fact all it really is is actually a "Layer and Outcrops" or "Sediment and Outcrops" function. Stratification is characterized by jetting out from the outcrops. This can be achieved by using functions like a diff scallar noise stretched to create the layers, and displace lateral for stratification. For example, canyons are mainly sedimentary rock and outcrops, not usually stratified rock which is seen more on ocean shores or wind-stricken slopes.

(http://i.imgur.com/2W9eeJl.png)

Changing source seems easy enough to subtract from get position (vectors). This is again a PRIME example of where Position Functions would be prime. My main XYZ node could filter in to all the SSS shaders and be able to move the whole crater through one node.

(http://i.imgur.com/fGGyEWO.png)

Full position Change

(http://i.imgur.com/ZN1cx8j.png)
Title: Re: Heightfield as Crater Shader
Post by: j meyer on November 07, 2015, 01:13:17 PM
Quote from: Dune on November 07, 2015, 10:44:00 AM
I understand, but I actually meant if it could be reproduced to more than one location, like a crater field. I guess not. Basically what is needed is random 'dots' to begin with and radiation from those dots.

It's possible Ulco,you just have to replace the "get postion..." by a "Get pos in tex" as usual
in the innards of mogn's setup.And instead of using the input of the "transform merge sh"
you have to combine both iterations otherwise,for instance with a "mix colour" as shown.

[attach=1]

For some reason piping it through the "Transform merge" doesn't work occasionally,that got
me to use other combining methods earlier on btw.
No idea why,though.

Title: Re: Heightfield as Crater Shader
Post by: WAS on November 07, 2015, 05:42:14 PM
Quote from: j meyer on November 07, 2015, 01:13:17 PM
Quote from: Dune on November 07, 2015, 10:44:00 AM
I understand, but I actually meant if it could be reproduced to more than one location, like a crater field. I guess not. Basically what is needed is random 'dots' to begin with and radiation from those dots.

It's possible Ulco,you just have to replace the "get postion..." by a "Get pos in tex" as usual
in the innards of mogn's setup.And instead of using the input of the "transform merge sh"
you have to combine both iterations otherwise,for instance with a "mix colour" as shown.

[attach=1]

For some reason piping it through the "Transform merge" doesn't work occasionally,that got
me to use other combining methods earlier on btw.
No idea why,though.

Yeah I got what he meant about the vector subtraction. I still don't see the need for rainbow radial lines?

here is another attempt with couple "ancient" craters and the newly blasted craters. Did some adjustments to the masks. Trying to get the right blast radius bigger but little issues.

(http://i.imgur.com/fp4U2Sm.png)

Doesn't seem to really work on small objects though like a small moon. the Extreme Y axis's don't work with the crater shader apparently. Definitely can't preview it.

(http://i.prntscr.com/4719cabd8e024632b9929a92d56bd996.png)
Title: Re: Heightfield as Crater Shader
Post by: AP on November 07, 2015, 07:19:24 PM
I was not aware you wanted a series of strata overhangs. In that specific moon crater all i see is a series stair stepping patterns.

Title: Re: Heightfield as Crater Shader
Post by: WAS on November 07, 2015, 09:13:55 PM
I'd love to see someone give their go at this. :)

Quote from: Chris on November 07, 2015, 07:19:24 PM
I tend to agree, a "Layer and Outcrops" or "Sediment and Outcrops" node might be more appropriately named. However when i think of Sediments (broken down soft rock), i think of the process of deposition with material transport.

I was not aware you wanted a series of strata rock layers. Here in the specific moon crater, all i see is a series of Outcrops.

I love that crater. Though what I'm referring to is a litter further from the impact on the descending sides of the mound. They'd basically lateral protruding disc like layers which were molten at one point created by the blast..

(http://www.nasa.gov/images/content/515308main_020111a.jpg)

The stratification is a lot older here and more layered out in this one

(http://hirise-pds.lpl.arizona.edu/PDS/EXTRAS/RDR/ESP/ORB_020500_020599/ESP_020555_1755/ESP_020555_1755_RED.NOMAP.browse.jpg)

Something similar on earth

(http://press.anu.edu.au/apps/bookworm/view/Exploring+the+Legacy+of+the+1948+Arnhem+Land+Expedition/4421/images/fig7.2_fmt.jpeg)

Also I found this as a nice reference of this type of ejecta crater we are doing here:

(http://farm6.static.flickr.com/5168/5319061425_1b1a78b8d7_o.jpg)
Title: Re: Heightfield as Crater Shader
Post by: AP on November 07, 2015, 09:27:12 PM
I have never seen overhangs on the moon so i am curious to investigate this more. A more side profile would help better understand the overall structure of what is trying to be achieved here. I'm looking at more photographs to try and find a better perspective in relation to this.
Title: Re: Heightfield as Crater Shader
Post by: AP on November 07, 2015, 09:33:29 PM
Some more references.
Title: Re: Heightfield as Crater Shader
Post by: Dune on November 08, 2015, 02:46:34 AM
@Jochen; Thanks for your input, I understand that too, but I was really talking about A LOT OF ejecta spots, like all over a planet, not just a few more than one. With the vector 3A setup you can get multiple craters (and edges), but getting ejecta out of all those dots would be the final trick. And indeed if you could twist&shear those ridges from the center outward of each of all those dots, you can get the overhangs also. Quite impossible, perhaps....
Title: Re: Heightfield as Crater Shader
Post by: mogn on November 08, 2015, 04:14:26 AM
Quote from: Dune on November 07, 2015, 10:44:00 AM
I understand, but I actually meant if it could be reproduced to more than one location, like a crater field. I guess not. Basically what is needed is random 'dots' to begin with and radiation from those dots.
Random dots:

X = mod(x, 1000)    Z = mod(z, 1000)
X' = subtract(x, X)   Z' = subtract(z, Z)
x2 = build vector(x, 0, 0)
z2 = build vector(0, 0, z)
Finalx = X' + 500*perlin(x2, 500)
Finalz = Z' + 500*perlin(z2, 500)
Random origins = [x, y, z] - [Finalx, 0, Finalz]
Title: Re: Heightfield as Crater Shader
Post by: Dune on November 08, 2015, 05:02:08 AM
Ah! But as usual, this is too magical for me, mogn. Could you possibly put this in a tgc? And can you radiate from this setup?

I've been tinkering as well and came up with this, but I can't put my fingers on the final step; to use the derived 'mask' on a flat area. As soon as you smooth the perlin dots, the nice radial stripes disappear. I've tried translating the stripes into displacement, and using that to derive another mask, but to no avail.
I won't probably use them very much, but it will come in handy. So if someone could takes this one step further..... we would have global ejecta.

Title: Re: Heightfield as Crater Shader
Post by: mogn on November 08, 2015, 07:20:20 AM
My thinking was wrong. The origin must not depend direct of the current point point, but 0f a fixed point inside the square km.
Title: Re: Heightfield as Crater Shader
Post by: j meyer on November 08, 2015, 10:39:39 AM
Ulco - sorry,misunderstanding on my side.
Title: Re: Heightfield as Crater Shader
Post by: Dune on November 08, 2015, 10:47:32 AM
To make it up, just solve the riddle I presented  ;)
Title: Re: Heightfield as Crater Shader
Post by: j meyer on November 08, 2015, 11:23:32 AM
 ;D
Title: Re: Heightfield as Crater Shader
Post by: WAS on November 08, 2015, 12:53:48 PM
All the math hurts my head. :\ lol
Title: Re: Heightfield as Crater Shader
Post by: Matt on November 08, 2015, 01:12:45 PM
WASasquatch, regarding position functions did you see my reply here?

http://www.planetside.co.uk/forums/index.php/topic,20709.msg206143.html#msg206143

Matt
Title: Re: Heightfield as Crater Shader
Post by: WAS on November 08, 2015, 03:06:07 PM
Quote from: Matt on November 08, 2015, 01:12:45 PM
WASasquatch, regarding position functions did you see my reply here?

http://www.planetside.co.uk/forums/index.php/topic,20709.msg206143.html#msg206143

Matt

Oh yes I did. What I tried didn't seem to allow me to move anything, but I may have set it up wrong. This would be nice to move the whole thing without multiple position points.
Title: Re: Heightfield as Crater Shader
Post by: mhaze on November 09, 2015, 09:43:00 AM
This is why we need a random and repeat shader ;)
Title: Re: Heightfield as Crater Shader
Post by: AP on November 09, 2015, 05:07:21 PM
I think Matt's proposal of randomizing the Shader array is a good idea. Perhaps options similar to the Populator can be added for the randomization.
Title: Re: Heightfield as Crater Shader
Post by: WAS on November 09, 2015, 05:45:16 PM
Quote from: Chris on November 09, 2015, 05:07:21 PM
I think Matt's proposal of randomizing the Shader array is a good idea. Perhaps options similar to the Populator can be added for the randomization.

It would not allow for cylindrical craters. This is good for stones and stuff that doesn't rely on shape, but not for shape-oriented randomization. The only thing that would allow this to happen is a Position Function which could have the option to anchor a planet and pipe in random numbers or other functions for random positioning, such as a constant vector as XYZ. Tranforming the terrain can possibly work but I can't seem to make it do anything.
Title: Re: Heightfield as Crater Shader
Post by: AP on November 09, 2015, 06:18:29 PM
Right, that makes sense. What is needed is some type of new function shader here.