mc光影吧 关注:8,602贴子:130,421

回复:SEUS V11教程——把Continuum 1.3体积光添加到SEUS V11

取消只看楼主收藏回复

第9楼一个错误,忘记改了,,,把第九楼复制的代码的"CREPUSCULAR_RAYS"修改为"VOLUMETRIC_LIGHT"


IP属地:广东17楼2020-10-13 18:06
回复
    把2585行的改成
    float CrepuscularRays(in SurfaceStruct surface)


    IP属地:广东18楼2020-10-13 18:09
    回复
      然后保存加载光影,并没有体积光,只是测试如果可以显示出画面正常游戏说明你可以下一步了,如果报错检查代码或是显卡问题


      IP属地:广东19楼2020-10-13 18:10
      回复
        吃个饭,马上回来


        IP属地:广东20楼2020-10-13 18:10
        回复
          OK,完成上面后打开composite2.fsh


          IP属地:广东21楼2020-10-13 18:23
          回复
            把这段改成


            IP属地:广东22楼2020-10-13 18:26
            收起回复
              这段改成
              #ifdef VOLUMETRIC_LIGHT
              surface.color.rgb += GetCrepuscularRays(surface);
              #endif


              IP属地:广东23楼2020-10-13 18:28
              回复
                然后删除这段改成这段
                vec3 GetCrepuscularRays (inout SurfaceStruct surface) {
                if (isEyeInWater > 0.9) {
                return vec3(0.0);
                } else if (rainStrength > 0.9) {
                return vec3(0.0);
                } else {
                #ifdef SEUS_VL
                float vlSample = texture2DLod(gcolor, texcoord.st, 3.2).a; //this will filter the volumetric light
                float sunglow = CalculateSunglow(surface);
                float antiSunglow = CalculateAntiSunglow(surface);
                vec3 rayColor = vec3(vlSample);
                float anisoHighlight = pow(1.0f / (pow((1.0f - sunglow) * 3.0f, 2.0f) + 1.1f) * 1.5f, 1.5f) + 0.5f;
                anisoHighlight *= sunglow + 0.0f;
                anisoHighlight += antiSunglow * 0.05f;
                rayColor *= colorSunlight * 0.5f + colorSunlight * 2.0 + colorSunlight * (anisoHighlight * 120.0f);
                //rayColor *= colorSunlight * 0.5f + colorSkylight * 4.0f + colorSunlight * (anisoHighlight * 120.0f);
                rayColor *= 1.0 - timeNoon * 0.9;
                rayColor *= 1.0 - timeSunriseSunset * 1.23;
                DoNightEye(rayColor);
                return rayColor * SEUS_VL_Strength * pow(1-rainStrength, 2.0f);
                #else
                float vlSample = texture2DLod(gcolor, texcoord.st, 3.2).a;
                float sunglow = 1.0 - CalculateSunglow(surface);
                sunglow = 1.0 / (pow(sunglow, 1.0) * 9.0 + 0.001);
                //sunglow = max(0.0, (1.0 / (pow(sunglow, 1.0) * 9.0 + 0.001) - (0.055 + 0.045 * timeNoon)));//code to make rays fade over distance
                sunglow += CalculateAntiSunglow(surface) * 0.2;
                vec3 raysSun = vec3(vlSample);
                vec3 raysSuns = vec3(vlSample);
                vec3 raysNight = vec3(vlSample);
                vec3 raysSunIn = vec3(vlSample);
                vec3 raysAtmosphere = vec3(vlSample);
                raysSunIn.rgb *= sunglow;
                raysSunIn.rgb *= colorSunlight;
                raysSun.rgb *= sunglow * timeNoon;
                raysSun.rgb *= colorSunlight * timeNoon;
                raysSuns.rgb *= sunglow * timeSunriseSunset;
                raysSuns.rgb *= colorSunlight * timeSunriseSunset;
                raysNight.rgb *= colorSunlight * timeMidnight;
                raysAtmosphere *= pow(colorSkylight, vec3(1.3));
                vec3 rays = raysSuns.rgb * SUNRISEnSET + raysAtmosphere.rgb * 0.5 * 0.0;
                rays += raysSun.rgb * NOON + raysAtmosphere.rgb * 0.5 * 0.0;
                rays += raysNight.rgb * NIGHT + raysAtmosphere.rgb * 0.5 * 0.0;
                vec3 Inrays = raysSunIn.rgb * IN_SIDE_RAYS + raysAtmosphere.rgb * 0.5 * 0.0;
                Inrays += raysNight.rgb * InSide_Rays_RisenSet + raysAtmosphere.rgb * 0.5 * 0.0;
                Inrays += raysNight.rgb * IN_SIDE_RAYS_NIGHT + raysAtmosphere.rgb * 0.5 * 0.0;
                Inrays *= mix(1.0f, 0.0f, pow(eyeBrightnessSmooth.y / 240.0f, 3.0f));
                DoNightEye(rays);
                return ((rays * 0.0058)*0.0049 + Inrays * 0.00001)*pow(1-rainStrength, 2.0f);
                #endif
                }
                }


                IP属地:广东24楼2020-10-13 18:30
                回复
                  然后把false改成true


                  IP属地:广东25楼2020-10-13 18:32
                  回复
                    然后保存进游戏


                    IP属地:广东26楼2020-10-13 18:32
                    回复

                      效果还非常好


                      IP属地:广东27楼2020-10-13 18:37
                      回复
                        对了,12楼是发错删除的不是系统删除,自己看吧,帖子没问题


                        IP属地:广东28楼2020-10-13 18:39
                        回复

                          对外面影响不大,就是月亮有点大
                          夜晚还是能看清地面的


                          IP属地:广东29楼2020-10-13 18:41
                          回复
                            为了使用方便,把他添加到光影设置里


                            IP属地:广东30楼2020-10-13 18:41
                            回复
                              打开"shaders.properties"


                              IP属地:广东31楼2020-10-13 18:42
                              回复