Water shader textures not following camera movement?

So I’ve decided to start looking into geometry shaders (as to how to even start to write one and where to put it), and went to check out the isosurface test, finding the water acting a bit weird:

Like, is that usual? Working as intended? Haven’t changed anything, except moving some of the sliders in the complementary gui which made it a bit more pronounced.

I don’t see this problem with the filter on my machine. I checked it in SS Editor.

I think @pspeed is moving the whole world when you move and not the camera (to avoid float precision when you move far away from the world’s origin). Since the water textures are sampled in world space, it gives this artifact…


Yeah. I had the same issue. I plan on writing something a little different in mine so i didnt come up with a workaround unfortunately.

Not sure I can compute the texture projection in viewspace in the shader… I’m afraid we’ll have a similar problem by rotating the cam. I’ll check whenever I have time.

Hey that sounds like exactly what’s going on. I’m not exactly planning on using it anytime soon, but it sounds like it would be easily solvable by feeding the world movement into the shader and just using that instead of the camera matrix when doing the uv offset.

Then again I don’t really know what I’m talking about so ¯\_(ツ)_/¯

P. S. Anyone know any other (preferably more basic) geometry shader examples? This one’s basically nearly an open world game.

The first should teach you what you want to know. The second would be cool for mist and stuff.




That’s actually a good idea…

BTW I’m not sure @pspeed’s iso surface demo uses geometry shaders.

I’m working on intergration some things from this to SS Editor and I haven’t seen geometry shaders there.

Nope. Triplanar mapping with some interesting distance stuff. The noise generator is the biggie really. That and everything else you will need. Mesh gen is quite quick.

@jayfella Cool thanks, I’ll take a look! What none of the sources I’ve read don’t exactly mention is where would one actually hook a geometry shader up to the renderer. Something like the DLSR that attaches directly to the viewport?

Well I suppose I was looking at the wrong thing then, figured the grass must be it.

Grass uses instancing afaik.
Tbh I don’t remember any useful use case implemented with geometry shaders.

In my IsoSurface demos, Grass is batched. Trees are instanced. (or batched for the far LODs)