-
Notifications
You must be signed in to change notification settings - Fork 25
Shader Compatibility Example
zomb_676 edited this page Aug 17, 2023
·
14 revisions
All stuff in this article is hacky way, just for people to have a try, and for shader dev a not good but can work example
All the example is just intended for feasible test and is far from perfect
BSL use ARR License, so even if you modified the source code yourself, don't distribute it
edit file BSL_v8.2.04/shaders/program/gbuffers_terrain.glsl

if((int(gl_MultiTexCoord1.x) & 0x100) != 0) { mat = 3.0; }
edit file shaders.properties
add the following stuff at the end of that file
iris.features.required = ssbo
bufferObject.0 = 65536
bufferObject.1 = 32
shimmer.config.lights = 0
shimmer.config.env = 1
edit file BSL_v8.2.04/shaders/program/deferred1.glsl

#extension GL_ARB_shader_storage_buffer_object : require

struct Light {
vec4 color;
vec3 position;
float radius;
};
layout (std140, binding = 0) buffer LightBuffer {
Light lights[2048]; // 16 8 * 2048
};
layout (std140, binding = 1) buffer EnvBuffer {
int uvLightCout; //32
int nouvLightCout;
vec3 camPos;
};

vec4 cameraBsaedWorldPos = gbufferModelViewInverse * viewPos;
vec3 actualWorldBase = cameraBsaedWorldPos.xyz + camPos;
vec3 lightColor = vec3(1.0);
int lightCount = min(uvLightCout + nouvLightCout, 2048);
for (int i = 0; i< uvLightCout + nouvLightCout ; i++) {
Light l = lights[i];
float intensity = smoothstep(0.,1.,1. - distance(l.position,actualWorldBase) / l.radius);
lightColor += l.color.rgb * l.color.a * intensity * vec3(1.5/*modify this for intensity change*/);
}
gl_FragData[0].rgb *= lightColor;follow the code below, the picture just show a range
