Unity3d Compute Shader New Solution simple body rendering technology and point attraction "three"

Source: Internet
Author: User
Tags pow

Unity3d Compute Shader New disintegration drawing technology and absorbing "three"

1.Compute shader is a big feature of DX11, apparently it really opens up the GPU's operations
The value of 2.Compute shader is also very large and is evident in science, engineering, medicine, and various applications.
3.GPU floating-point arithmetic and precision are several orders of magnitude higher than the CPU, and the structure of parallel operation of the GPU, instructions will not be lengthy waiting

这几天听了恩雅的 "Waters Show The Hidden Heart"音乐,当时耳机烂成一坨,我就像他们放Hi歌一样放了出来,于是有人按捺不住了,说放的哀曲,当时我那个心碎啊。

http://blog.csdn.net/baidu_26153715/article/details/45752349 by Tian Na
If I am, I can't help it!

Preliminary preview of Compute Shader effect
    • Look from the outside.

      every point has a color, and I don't know if you found it .
      Feel how the world can be described in a few words

    • Look from the inside.

      each point really has a unique color, but it is not close to look
      This pixel world, fake look dizzy

    • The collapse point of the cube sucks and sprays.

      Oh, whoa! A bunch of dots are collapsing.
      A bunch of crazy dots, all-pervasive

Come on, Hava a look
    • Find the center of the Cube particles

      This may seem strange, why there is such a disturbing line, ouch!

                                            -也许是我的Camera离得太近无法焦距吧!

      But we can see the obvious cone of light, and remember, the apex of the cone is there.
      What about this one?

      It is clear that the pillar of light is out of sight, it is too far away.

      So, how is the point in the middle of the cube found, and if you count then do it

      Yes, I can say that the ID of all the dots in the cube is within the range of xyz= (64,64,64), altogether

        哟,感脚有点不对,怎么总点数不是他的2倍数目!大哥,那是一维中才要得

      So the ID of the center point (call her coordinates!) for (32,32,32), you can count now.
      1 sheep, 2 sheep, 3 sheep, 4 sheep, and radiant, Gray Wolf, 14 drops of sheep, to hang a drop of sheep, yo ... Where's the number?
      hahaha, in fact, can be counted, but I calculate with the calculator, my arithmetic is not good,

      This... Here it is. Still can drip ....

    • Cone cylinder Color
      Have you used debug in shader language? To be honest, debug is not a very good function, so the best way is to use color display, but also can see from RGB the distribution of XYZ.

      Here I'm using POW (RGB, odd), a POW is clear, and my goal is to find the center point of the cube
      Why here is odd, if want to see, also may as well, small two fast:

      Obviously the black place rgb<=0; actually RGB also >=-1 ...

The technology
    • Look at a diagram first

      I think it's also good to do operations on the GPU.

    • In Compute shader, do a little, suck and squirt.


      Obviously the first sentence is the vector of the position of the suction.
      The second sentence is the displacement to that position, where the displacement on the acceleration of the 2 times integral
      After a simple operation in the compute shader, the following is the case:

    • Body point plot-build in shader
      Oh, drink a little beer, feel the head is stuffy,

      Then you can get the following effect from above

For people who can see very well in code.
    • Use in C #

    • Use in Compute Shader

    • Use in Shader

    • Promotion
      Promotion of the thing, then picked up, not simply use a point, you can use the model data or grid to replace the point, not simple is to use and suck and spray, but do water physics simulation; Not simple is the transmission of the sample, but based on the advanced illumination model rendering of the body algorithm.

Unity3d Compute Shader New Solution simple body rendering technology and point attraction "three"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.