I can then add a small multiple of this vector to my UV coordinates, before sampling from the main water texture. Instead of drawing the colours from this texture, I instead take the red & green channels and subtract 0.5f to turn them into a pseudorandom 2D vector that changes smoothly over time & space. Here I'm using a texture with some low-frequency colour noise (tiling smooth blobs of random colours), and scrolling it across the display geometry over time. I posted a libgdx example in this post: 2d water animation is jagged and not smooth (see answer about texture filtering)Ī common way this is done is using an indirect texture lookup in the shader to distort the display texture: Realism is not the point here, just some nice looking water like movements.) Solution from DMGregory (I'm also open to different ideas/answers on how to animate the given texture. And if so, how do I map this model to the given texture? Keeping all the curves and what not.Whats the math-model for this? Something with springs, where forces push/ pull?.But I have no clue how to implement something like this: Imagine if someone would slightly pull at one vertex of these cells and the neighbored cell would expand and the cell I pull towards to (or push to) would contract. I think the best looking animation would be, if the individual cells would expand and contract, kind of like a web or piece of cloth. So that reflections under the water surface would also move, but much slower. The next thing I tried is to add another layer and implement a parallax effect. Of course now the whole texture is moving which looks kind of unrealistic. I tried to move the texture with a sin wave: texture.y += sin(angle). The problem I now have is, that I don't know how to animate this texture so the water looks nice. The actual texture is transparent, I added the green-like color for clarity. I use the following, a little abstract texture: I currently implement a game with a top down view of the ocean. Answers without enough detail may be edited or deleted. Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |