GLSL / HLSL 着色器中的星球大战全息效果
有人知道如何在 HLSL / GLSL 中实现类似星球大战的全息效果吗?
Does anybody have any idea how to implement Star Wars like holographic effect in HLSL / GLSL ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编辑:
我的答案是指“经典”的蓝色全息外观,而不是本在互联网上找到的更现代的第 1-3 集电影中更绚丽、微红色的外观(问题没有明确说明需要哪一个)。< br>
如果需要更现代的红色外观,显然必须使用红色而不是蓝色,并为“光环”添加绽放效果(阈值/明亮通行证、模糊、添加到图像,请参见例如 此处)。
(原答案)
这看起来大多像半透明、不太准确的蓝色“黑白”效果。
因此,我会计算亮度(类似于
dot(color.xyz, vec3(0.67, 0.21, 0.14))
虽然统一权重 (0.333) 可能看起来也不错),并将其输出仅蓝色通道,可能会增加一些偏差并乘以一些增益,以使其可以稍微调整。然后,启用 alpha 混合,并使用恒定 alpha 对其进行调整,使其透明,如您所愿。
也许人们也可以在亮度中添加一点柏林噪声,以使其稍微“不那么准确”,并且更多地呈现出稍微“不完美”的外观,就像电影中的全息盗贼那样。
EDIT:
My answer refers to the "classic" blueish holonet appearance, rather than the more bloomy, reddish appearance in the more modern Episode 1-3 movies that Ben found on the internet (the question doesn't make clear which one is desired).
If the more modern red look is desired, one would have to use red instead of blue, obviously, and add a bloom effect for the "aura" (threshold/bright-pass, blur, add to image, see for example here).
(original answer)
That looks mostly like a semi-transparent, not too accurate, blueish "black and white" effect.
Thus, I'd calculate the luminance (something like
dot(color.xyz, vec3(0.67, 0.21, 0.14))
though uniform weight (0.333) will probably look ok too), and output that in the blue channel only, possibly adding some bias and multiplying some gain, to make it a little tweakable.That, and enable alpha blending, and tweak it with the constant alpha as transparent as you like it.
Possibly one could add a bit of Perlin noise to the luminance too, to give it a bit "less accuracy" and more of a slightly "imperfect" appearance, like those holo thigies have in the movies.