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. |