阴影贴图多重纹理
有一个关于阴影贴图的教程: http://www.paulsprojects.net/tutorials/smt/smt.html
好的,但我不知道如何制作具有多重纹理的场景。
如果在阴影贴图的第三遍中需要绑定阴影贴图投影纹理来进行深度比较,如果我需要绑定阴影贴图纹理,如何绑定其他纹理?
我必须将阴影贴图设置为要绑定的单独纹理吗? 像这样的东西:
- 活动阴影映射纹理
- 活动纹理 1
- 活动纹理 2
我尝试过,但它不起作用(也许我做错了什么)。
There is this tutorial about shadow mapping:
http://www.paulsprojects.net/tutorials/smt/smt.html
Ok, but I did not realize how to make a scene with multitexture.
If in the third pass of shadow mapping It is need to bind the shadow mapping projected texture to perform depth comparison, HOW can I bind another textures if I need to bind the shadow mapping texture?
Must I set shadow mapping as a separate texture to be bind? Something like this:
- Active shadow mapping texture
- Active texture 1
- Active texture 2
I tried that but it did not work (maybe I've done something wrong).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是为了澄清一下,您有一个预先存在的多纹理场景想要进行阴影贴图吗?
如果是这样,激活所有纹理单元应该可以工作(如果你有足够的纹理单元,我认为 OpenGL 1.4/1.5 规范只要求至少两个;通过 glGetIntegerv() 检查 GL_MAX_TEXTURE_UNITS_ARB)。 如果您没有足够的纹理单元,则必须使用多通道渲染/混合。
Just to clarify, you have a pre-existing multi-textured scene you want to shadowmap?
If so, activating all your texture units should work (if you have enough, I think the OpenGL 1.4/1.5 spec only calls for a minimum of two; check GL_MAX_TEXTURE_UNITS_ARB via glGetIntegerv()). If you don't have enough texture units you'll have to use multi-pass rendering/blending.
是的,对于深度比较通道,阴影贴图应该绑定在单独的纹理单元上。
激活设备后不要忘记启用/禁用纹理。
yes, for the depth comparison pass, the shadowmap should be bound on a separate texture unit.
don't forget to also enable/disable texturing after activating the unit.