Hybrid use of programmable assembly line and fixed assembly line in d3d

Source: Internet
Author: User
I have just implemented a terrain reality with the programming pipeline, but when the programming pipeline is mixed with a fixed pipeline, something that puzzles me, I use effect to render the terrain of the programming assembly line. As long as the programmable assembly line is enabled, the fixed assembly line will have problems: see:

 

The terrain above is well rendered, but all the character models below are black, after testing, we found that the location of the model also programmed the location of the world matrix set in the FX file. What does this mean? That is to say, when the programmable assembly line is turned on, it is not automatically closed (I just thought, haha ), what we need to do is to manually close the programmable pipeline to achieve rendering of our fixed pipeline. How can we close it? In fact, it is very simple. effect is also the fixed-point Renderer and pixel Renderer. Closing the programming pipeline is to close these two. It is called at the end of rendering in Our programmable pipeline:
M_device-> setvertexshader (0 );
M_device-> setpixelshader (0 );
The m_device above is the environment pointer of d3d. by calling the above two functions, the programmable pipeline is disabled,
The added effect is as follows:

The character is rendered.

This is just a discovery. Well, it's my pleasure to write it down and record it.

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.