Shadersimpler (9): Deferred shading with multiple render targets

Source: Internet
Author: User

Source code download: http://myshaders.googlecode.com/files/ShaderSimpler_05192007.rar

Today, I tried to use MRT for deferred shading. It was modified on the basis of the previous example. The main points are as follows:

  1. Use setrendertarget to set each render target;
  2. Use "color [N]" in pixel shader to write to each render target;
  3. Note that the bits of each surface of the MRT must be consistent, so two float texture of g16r16 are used in this example to save the position.

OK. That's simple. The rendering effect is the same as that in the previous example. This exampleProgramThe test passed on GeForce 7600gt, but not on other video cards.

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.