修改gl_FragColor.a会直接搞乱雾吗?
我在 iOS 构建中发现在我的 Mac 上运行良好的代码存在问题。打开雾后,我会看到不可预测的、通常不需要的渲染结果,但仅限于在着色器末尾写入 gl_FragColor.a 时。如果我使用临时变量,并将其分配给 gl_FragColor 的所有四个通道,我就会看到我所期望的结果。这是预期的结果,还是 Unity 的问题? (对于这些问题着色器,如果删除而不是注释掉片段着色器代码,我会得到不同的结果,所以我打赌是后者,但如果您愿意回答,那么您希望比我更了解。)
I'm seeing issues on iOS builds for code that works fine on my Mac. With fog turned on, I'm seeing unpredictable, generally undesired rendering results, but only when writing to gl_FragColor.a at the end of my shaders. If I work with a temporary variable, and assign to all four channels of gl_FragColor with it, I see what I expect. Is this to be expected, or is it a problem with Unity? (With these problem shaders, I'm getting different results if I delete, as opposed to commenting out, fragment shader code, so I bet it's the latter, but if you feel comfortable answering, you hopefully know better than I do.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
多雾路段?您正在使用 OpenGL 着色器;没有雾,除非着色器定义了它的工作原理。您是否依赖传递给片段着色器的某些每个顶点值来为您做雾?
除非 Unity 以某种方式放大或改变你的着色器,否则雾不应该是你无法控制的。
Fog? You're using an OpenGL shader; there is no fog, unless the shader defines how it works. Are you relying on some per-vertex value passed to the fragment shader to do fog for you?
Unless Unity is amplifying or altering your shader in some way, fog is not something that should be out of your control.