社区
游戏开发
帖子详情
关于FOG的问题
gz_wuling
2010-09-25 09:13:38
FogVertexMode=LINEAR;
FogStart=0.0f;
FogEnd=303.0f;
FogColor=0x00ACCCCC;
FogEnable=true;
以上这段FOG的代码加到directx sdk 的 SHADOWMAP 例子 的 OnFrameRender函数内不起作用,而加在 MESH 和 SkinnedMesh 的例子上则可以,不知有没有高手试过?
...全文
174
5
打赏
收藏
关于FOG的问题
FogVertexMode=LINEAR; FogStart=0.0f; FogEnd=303.0f; FogColor=0x00ACCCCC; FogEnable=true; 以上这段FOG的代码加到directx sdk 的 SHADOWMAP 例子 的 OnFrameRender函数内不起作用,而加在 MESH 和 SkinnedMesh 的例子上则可以,不知有没有高手试过?
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
luoya263547560
2010-09-27
打赏
举报
回复
[Quote=引用 4 楼 gz_wuling 的回复:]
我搞错了,上面的代码就是用在shader里的,这是否仍与固定管线有关系?
用在固定管线的代码是:
DWORD FogColor = D3DCOLOR_RGBA(255, 128, 128, 255);
pd3dDevice->SetRenderState(D3DRS_FOGENABLE, TRUE);
pd3dDevice->SetRenderState(D3DRS_FOGCOLOR, F……
[/Quote]
shader里面的雾效是要计算出来的,固定管线的雾效和shader不能同事使用,如果你的物体是通过shader渲染,而雾效是通过固定管线,那么雾对该物体应该是不起作用的。
shader打开后没有关闭话,固定管线应该不会进行,使用
SetPixelShader(0);
SetVertexShader(0);
将shader管线关闭(当使用完shader之后)。 个人的建议仅供参考。
gz_wuling
2010-09-27
打赏
举报
回复
我搞错了,上面的代码就是用在shader里的,这是否仍与固定管线有关系?
用在固定管线的代码是:
DWORD FogColor = D3DCOLOR_RGBA(255, 128, 128, 255);
pd3dDevice->SetRenderState(D3DRS_FOGENABLE, TRUE);
pd3dDevice->SetRenderState(D3DRS_FOGCOLOR, FogColor);
float fStart = 0.0f;
float fEnd = 10.0f;
pd3dDevice->SetRenderState(D3DRS_FOGVERTEXMODE, D3DFOG_LINEAR);
pd3dDevice->SetRenderState(D3DRS_FOGSTART, *(DWORD *)(&fStart));
pd3dDevice->SetRenderState(D3DRS_FOGEND, *(DWORD *)(&fEnd));
无论用那个,都不起作用
芳草天
2010-09-27
打赏
举报
回复
还是少用固定管线的好,效率不高,也不灵活。。
xingzhe2001
2010-09-26
打赏
举报
回复
fog依赖于固定管线的矩阵,你有没有settransform? 还有你可以先把shader禁用掉改用固定管线,然后逐渐加shader看是什么原因。
张赐
2010-09-26
打赏
举报
回复
使用固定管线看看fog起作用没有
还有在使用shader的过程中同时使用固定管线是没有作用的
Unity 官方推荐插件
Fog
Volume 3.2.1p3
Unity 官方推荐插件
Fog
Volume3 雾、云、大气雾效统统囊括 Unity 官方推荐插件
Fog
Volume3 雾、云、大气雾效统统囊括
Height
Fog
v2.0
Height
fog
2.0! Now LWRP supported! (For LWRP version: 4.x.x LWRP package required, Unity 2018 required) Bug fixes, new property -
Fog
Emission Color, now you can change
fog
and object emission separately! Make your unique atmosphere! NOTE: Per object shader, not support terrain - Perfect for creating a height
fog
, mist, depth effect - High performance - Works great even on low-end devices - Simple and user friendly interface - Global and individual controllers included - Supported GPU Instancing and Material Property Blocks - Imitate translucency - Imitate overheat materials - Imitate water depth - Imitate subsurface scattering - Imitate gradient self-illuminate materials - Easy to combine with standard
fog
- VR ready - Manual included - Post Processing Stack V2 presets included - Wax, Ice, Overheat, Water Depth samples included
Volumetric
Fog
Mist 2 2.3.1.unitypackage
All in one bundle! This pack includes: ✓ Volumetric
Fog
& Mist 2 for Universal Rendering Pipeline (New Asset!) ✓ Volumetric
Fog
& Mist for Builtin Pipeline ✓ Dynamic
Fog
& Mist for Builtin pipeline and also for Post Processing Stack v2. Volumetric
Fog
& Mist 2 is a complete redesign of Volumetric
Fog
& Mist, written from scratch for Universal Rendering Pipeline, with a focus on
fog
areas which makes it easier to use and performant.
Vertical
Fog
3.0.unitypackage
Vertical
Fog
Fog
_
FOG
_
Fog
network routing algorithm
游戏开发
8,323
社区成员
23,684
社区内容
发帖
与我相关
我的任务
游戏开发
游戏开发相关内容讨论专区
复制链接
扫一扫
分享
社区描述
游戏开发相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章