简体   繁体   English

多次渲染对象

[英]Rendering an Object more than once

Right now I'm facing the issue of rendering the same objects more than once in Directx 11, as the object has: 现在,我面临着在Directx 11中多次渲染相同对象的问题,因为对象具有:

  • A diffuse shader 漫射着色器
  • A directional lighting shader 定向照明着色器
  • A texture shader 纹理着色器

Now the final color should be all of them somehow put together, maybe something like this: 现在,最终的颜色应该以某种方式将它们全部组合在一起,也许是这样的:

  • Render Diffuse 渲染扩散
  • Render Texture 渲染纹理
  • Render Directional 定向渲染

Final Color = (Diffuse + Texture) * Lighting // Not sure about this though 最终颜色=(漫反射+纹理)*光照//虽然不确定

But how can this be archieved? 但是,如何归档? Without the EFFECTS FRAMEWORK! 没有效果框架!

It can be achieved in DirectX11 a couple of ways. 它可以通过DirectX11中的两种方法来实现。 The first is by making an "uber shader". 首先是制作“超级着色器”。 This means to do diffuse, texture and lighting in the same shader. 这意味着要在同一着色器中进行漫反射,纹理和照明。 The second is to use dynamic shader linking and dynamically link together unique diffuse/texture/lighting shaders at runtime. 第二种是使用动态着色器链接,并在运行时将唯一的漫反射/纹理/照明着色器动态链接在一起。 The June 2010 sdk has a good example of dynamic shader linking. 2010年6月的SDK有一个很好的动态着色器链接示例。 Also the usual combination of colors is: 同样,通常的颜色组合是:

Final Color = Diffuse * Texture * Lighting 最终颜色=漫射*纹理*照明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 C ++对象被摧毁了不止一次 - C++ object destroyed more than once 不止一次加载DLL? - Load a DLL More Than Once? 文本出现不止一次 - Text appearing more than once 是否在表达式中通过其名称和明确定义的引用多次修改对象? - Is modifying an object more than once in an expression through its name and through its reference well-defined? 当要访问的对象被多次封装时,如何正确使用setter? - How to use setters properly when the object to be accessed is encapsulated more than once? 为什么对象“ a”中的字符串被多次调用后,在下面的代码中没有被破坏? - Why isn't the string in object “a” getting destroyed in the following code after being called more than once? 我可以在同一个表达式中多次使用 object 而不安全地修改它吗? - Can I use the object in the same expression more than once without modifying it safely? 当您多次声明同一对象/变量时会发生什么(新手) - what happens when you declare the same object/variable more than once (newbie) 有目的地多次链接同一对象时,如何避免出现多个定义错误? - How do I avoid multiple definition errors when purposefully linking the same object more than once? 多次指定 Object - 从 C++ 调用 asm 代码时无法解析的外部符号 - Object specified more than once - unresolved external symbol when calling asm code from C++
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM