Displace moving everything to the left
Loopysue
ProFantasy 🖼️ 40 images Cartographer
I'm having a bit of trouble setting up some ripples for Marine Dungeon 2. The ripples are ok-ish, but I can't work out how to stop the Displace effect moving them left by an amount proportional to the displace amount.
Is it the normal map to blame?
You can see that there is a noticeable gap between the left side of the wall and the start of the ripples, while on the right side of the wall the ripples are right up against the wall.
Comments
What are your normal map and Displace settings? Are you sure that the displace effect on the right is up against the wall and not under it? I wouldn't be surprised at all if I got a 1-pixel offset in there somewhere that it shouldn't have been.
Hi Joe :)
There are two displacements being carried out using the same normal map at different scales. I've turned the shadows off so you can see the ripples and the wall more clearly. The second shot is the first Displace, and the third shot is the second Displace.
I boosted the height factor of the normal map when I made it, because I wasn't getting enough swirliness. Maybe that is affecting the result?
Thanks for your help, Joe :)
I have managed to reduce the sideways drift by removing one of the Displace effects, the Blur and Blend mode. I think that for now this is the best I can do, and suspect that I was pushing the effects to do unexpected things by pushing them a long way beyond what is normally expected of them. This is a much better result, and I will probably stick with this one now.
The Z axis of the normal map (the blue channel) isn't considered for Displace, just the X and Y axes (the red and green channels), so adjusting the height of the normal shouldn't have any impact.
It looks like you have a straight cellular noise texture as the basis for the normal map (SDF of a random set of points + a slight blur). Have you tried a fractal texture for the displacement? Using two displacements on top of each other at different scales is more or less the start of a fractal construction.
Here's an example of a Ridged Multifractal from Wilbur (it got a little uglier when I made it mostly seamless):
You can also synthesize the double-displacement thing directly into a single displacement map. You might get better compression if you push the blue channel to a solid color.
I will try that, Joe - Thanks very much for taking the time to create it.
I found a way around it by playing with a red png and a green png for adjustment.
This shot shows the shift happening with just the displace I was using before, a little exaggerated to make it clear.
This is with the plain red png distort
And this is with the plain green distort.
I am thinking that my normal map might be at fault somehow, so this is your normal map without the extra adjusting distorts
And then again with them (though I had to increase the Displacemet amount on the correction effects by a factor of 3 to make it go right for your normal map). It's a bit like using the Displace to move the whole thing back on x and y axis separately, but I guess that's quite an accurate description if the 'normal' maps I'm using are just two plates of solid colour.
Here are the adjustment pngs I was using - one green, and one red.
That definitely looks like a 1-pixel shift in the horizontal channel (it looks to be three times as bad in the third-sized image I posted). I suspect that the offset is due to rounding errors in the horizontal calculation (it always truncates, which moves things one to the left). It would be easy to add an offset to the code, but that would break all existing content slightly. A GUI-based offset (you type X and Y offsets on the dialog) would force the fix for the problem onto the user (you), but requires more setup and training and delivery.
Since there doesn't seem to be a logic that dictates a relationship between the red and green corrections that will be required to sort things out, that would be a really excellent idea, Joe :)
I would rather be able to control it with a bit of practice, than have to add 4 separate Displace effects to do the same thing.
Glad that this issue comes up again - I almost forgot about it. I had the same problems already when I created ripples around poles and noticed the left shift. I tried to minimize it but could not get rid of the left shift - so you still notice it even on my images...
It was your thread that gave me the initial idea to do this :)
It works ok if you use the correctional displacements after the main one. One red and one green. They are just 500 px bitmaps of pure red and pure green.
There's no rhyme or reason to the actual amount each will be required, but at a scale of 500 I needed a displacement value of anywhere between 0.2 and 3.0, depending on how bad the drift was. Using the same values in both green and red correction displacements to start with helped a lot, otherwise it is a bit like trying to saw just the right amount off the legs of a rocky table without a tape measure.
They are just 500 px bitmaps of pure red and pure green.
500px shouldn't be needed if they are uniform, 1px should be enough.
This is true. I just happened to have a blank bitmap file open in GIMP when I decided to try it, and it was that size.
It's exactly what I wished I could do when I threw down all those Edge Striping effects in my Old Fishery map, but I had no idea how to improve it.
I remember @WeathermanSweden's great thread attempting to improve the effect with displace, but my laptop was already struggling with all different entities that I'd place edge stripes around. So I just left them as circles.
I was so proud of my "ripples" at the time!
I've got a few watery locations to map for my current game, so I'm really looking forward to the Marine Dungeons 2 annual.
Thank you, Raiko
I did some better waves yesterday, and then had to change the ripples quite a lot to make things sit right with the rest of the style.
Hope you still like it.