开发者

Adding whirl effect on DirectX/OpenGL application

开发者 https://www.devze.com 2023-02-27 02:04 出处:网络
After we have finished rendering a frame either using DirectX or OpenGL in C++, I would like to add this \"swirling\" effect just on a portion of the frame. Something like this below:

After we have finished rendering a frame either using DirectX or OpenGL in C++, I would like to add this "swirling" effect just on a portion of the frame. Something like this below:

Adding whirl effect on DirectX/OpenGL application

So how do we normally 开发者_StackOverflow社区achieve this?


You could either:

  1. Render a grid of vertices and use a vertex shader to rotate each vertex around the center according to its distance from the center. This would require lots of vertices towards the center, to maintain clean curvature.
  2. Render a single quad and use a fragment shader to similarly rotate the texture-coordinate. This would render more accurately, but would also be slower than the fragment shader.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号