代码拉取完成,页面将自动刷新
/*
(C) 2019 David Lettier
lettier.com
*/
#version 140
uniform float osg_FrameTime;
uniform sampler2D filmGrainTexture;
uniform vec2 enabled;
out vec4 fragColor;
void main() {
float amount = 0.1;
vec2 texSize = textureSize(filmGrainTexture, 0).xy;
vec2 texCoord = gl_FragCoord.xy / texSize;
vec4 color = texture(filmGrainTexture, texCoord);
float toRadians = 3.14 / 180;
if (enabled.x == 1) {
float randomIntensity =
fract
( 10000
* sin
(
( gl_FragCoord.x
+ gl_FragCoord.y
* osg_FrameTime
)
* toRadians
)
);
amount *= randomIntensity;
color.rgb += amount;
}
fragColor = color;
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。