shore wave challenge

Started by Dune, September 27, 2020, 02:20:32 AM

Previous topic - Next topic

Dune

Thanks a lot, Jon. Study material!

WAS

Oh cool, definitely interested in how you isolate different parts.

WAS

Immediate issue I found with trying to use "get normal" is it uses the normal of the water plane, even if I feed it to the terrains Compute Terrain. I don't feel that's correect logic, should be able to feed directly, or it should be only pulling from a Compute Normal/Terrain in the scene.

I tried using the North, South, West, East masks, hoping they would be based on the terrain, to simply mask surface layers with leans in the right direction. No go. It gets the normals of the water plane and sine wave.

WAS

So I rendered out a ortho mask of N,W,S,E faces (N,W,S in RGB and East as just scalar) and used these as masks on my waves for twist and shears on the appropriate directions. Seems to work good for the simple shape, though I forgot to turn off the sun in the ortho and do luminosity, so masks are a little wonky.

I think the get normal needs an update to allow to actually plug a network that the get normal needs to come from. Even when I masked the main terrain, and than converted RGB to scalar, and used that on the waves, the masks converted to normals on the waves. Go figure. Ugh. This would be entirely possible if you could get normals from what you actually want, not whatever it does.

Dune

#34
Mmmm, I didn't have a chance to look at it yet, but this seems disappointing. I didn't get the right normals, and the NSWE masking isn't what I was after. It is easy enough for a specific area to twist and shear or vdisp into the desired direction, but was looking for something that always works.
I'll have a look at it today...

It must be possible to write code that twists or redirects or vdisps in the direction of white (versus black) in some mask, not hard X or Z. Maybe that would be a feature request for Matt....

It works if you use a compute normal after the wave displacement and use  lateral displacement driven by the heights, instead of the vdisp.

WAS

#35
Quote from: Dune on October 01, 2020, 02:22:37 AMMmmm, I didn't have a chance to look at it yet, but this seems disappointing. I didn't get the right normals, and the NSWE masking isn't what I was after. It is easy enough for a specific area to twist and shear or vdisp into the desired direction, but was looking for something that always works.
I'll have a look at it today...

It must be possible to write code that twists or redirects or vdisps in the direction of white (versus black) in some mask, not hard X or Z. Maybe that would be a feature request for Matt....

It works if you use a compute normal after the wave displacement and use  lateral displacement driven by the heights, instead of the vdisp.

NWSE masks aren't a certain direction. Lol it's 360 degrees as demonstrates and intensity modulated by fuzzy zone allowing curving of the lean.

I don't know what you are after besides what I just explained and you won't be able to get directions for any vector disp without a proper get normal that works cross-object on only what you specify. So you'll have to render out the masks from get normal like was suggested earlier.

The only way this will be possible in TG is if get normal is updated to work better. Interestingly I remember normal convergence in the past from I think cinema 4d, where you could lean all normals towards a center target (or away).

Dune

#36
I see it now, the wonky part on the left made me think it were hard-edged directions. Wasn't awake fully :P

This is what I was trying to get to work. Would be so handy!

Matt

#37
@Dune, Visualise Normal maps the values to the range 0..1. For displacement purposes you probably want Get Normal because it provides the raw data which includes negative values. In any case, it isn't possible to get the normal of a different object because of how Get Normal works.

https://www.planetside.co.uk/wiki/index.php/Get_Normal

@WAS, Being able to retrieve the normal of a separate object would be very useful but needs some mathematical definition of what point on the other object we want to sample. One way to do this is to cast a ray to the other object but we also need to define what direction to cast the ray (e.g. down). I hope we can add this feature in future.
Just because milk is white doesn't mean that clouds are made of milk.

WAS

Quote from: Matt on October 02, 2020, 04:37:46 PMBeing able to retrieve the normal of a separate object would be very useful but needs some mathematical definition of what point on the other object we want to sample. One way to do this is to cast a ray to the other object but we also need to define what direction to cast the ray (e.g. down). I hope we can add this feature in future.

Forgive my ignorance here, cause it seems that way to me at least, but isn't the "point" we want defined by it's usage already on object A? Isn't there someway to simplify this result to texture or final space as a range 0-1+ or what not to than apply as masks on anything. Perhaps tihs is more functionality of something entirely different based on get normals, but just thinking. I want to say rasterize, but I feel that's just totally wrong and wasteful.

WAS

#39
Quote from: Dune on October 02, 2020, 02:10:28 AMI see it now, the wonky part on the left made me think it were hard-edged directions. Wasn't awake fully

That's probably from me, also, not being fully awake, and rendering out the RGB + Scalar maps with the sun and colour instead of blackness and luminosity. Oops.

Additionally, from what I see at beaches and stuff, waves seem to follow the basic smooth form of terrain, and "break" physically on obstacles only very near or at the surface, which can probably be done based on separate shaders like "rocks" and using scalars, so the base "landscape" terrain should be as smooth as possible for wave angles to follow.

Dune

Thanks Matt. Too bad about the visualize normals (and that get normal won't work, which is understandable { hoping I never 'get normal' :P  }).
I also thought of copying terrain A to object B, visualize its normals there and then smooth the terrain again, to then add the displacement wanted (say wave sinuses), and then apply the visualized by vdisp. But that probably won't work either because of the direction of calculating....

@WAS: I did use the smoothing function to get smoother areas for the sinuses to follow (with its drawbacks).

WAS

Quote from: Matt on October 02, 2020, 04:37:46 PM@WAS, Being able to retrieve the normal of a separate object would be very useful but needs some mathematical definition of what point on the other object we want to sample. One way to do this is to cast a ray to the other object but we also need to define what direction to cast the ray (e.g. down). I hope we can add this feature in future.

Coming back to this, maybe we could have this be something in final space. So all the alts of objects, and textures etc all be in final space, so you'd have to use transform shaders, but would align as they do already across objects and final space alt limits etc. I wanted to approach this again for use of wet shores but again forgot about where it derives on objects/planets.