Shader复杂度检测

Shader测试样本

#version 300 es
precision highp float;
precision highp int;
#define HLSLCC_ENABLE_UNIFORM_BUFFERS 1
    #if HLSLCC_ENABLE_UNIFORM_BUFFERS
    #define UNITY_UNIFORM
    #else
    #define UNITY_UNIFORM uniform
    #endif
#define UNITY_SUPPORTS_UNIFORM_LOCATION 1
    #if UNITY_SUPPORTS_UNIFORM_LOCATION
    #define UNITY_LOCATION(x) layout(location = x)
    #define UNITY_BINDING(x) layout(binding = x, std140)
    #else
    #define UNITY_LOCATION(x)
    #define UNITY_BINDING(x) layout(std140)
    #endif
uniform 	vec4 _Color;
uniform 	float _Dither;
layout(location = 0) out mediump vec4 SV_Target0;
vec2 u_xlat0;
bool u_xlatb0;
void main()
{
    vec4 hlslcc_FragCoord = vec4(gl_FragCoord.xyz, 1.0/gl_FragCoord.w);
    u_xlat0.xy = floor(hlslcc_FragCoord.xy);
    u_xlat0.xy = u_xlat0.xy * vec2(0.5, 0.5);
    u_xlat0.x = u_xlat0.y + u_xlat0.x;
    u_xlat0.x = fract(u_xlat0.x);
    u_xlat0.x = (-u_xlat0.x) + -1.0;
    u_xlat0.x = _Dither * u_xlat0.x + 1.0;
    u_xlatb0 = u_xlat0.x<0.0;
    if(u_xlatb0){discard;}
    SV_Target0 = _Color;
    return;
}

  • 5
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值