Skip to content

Commit 5d0bd81

Browse files
committed
Use texture instead of texture2D for MacOS.
1 parent f0a06c8 commit 5d0bd81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/resources/assets/oc2/shaders/core/projectors.fsh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,11 @@ bool getProjectorColor(vec3 worldPos, vec3 worldNormal,
8484

8585
vec4 projectorUvPrediv = CLIP_TO_TEX * projectorClipPosPrediv;
8686
vec2 projectorUv = projectorUvPrediv.xy / projectorUvPrediv.w;
87-
float projectorDepth = texture2D(projectorDepthSampler, projectorUv).r;
87+
float projectorDepth = texture(projectorDepthSampler, projectorUv).r;
8888
float projectorClipDepth = projectorDepth * 2 - 1;
8989

9090
if (projectorClipPos.z <= projectorClipDepth + DEPTH_BIAS) {
91-
vec3 projectorColor = texture2D(projectorColorSampler, vec2(projectorUv.s, 1 - projectorUv.t)).rgb;
91+
vec3 projectorColor = texture(projectorColorSampler, vec2(projectorUv.s, 1 - projectorUv.t)).rgb;
9292
float dotAttenuation = clamp((d - DOT_EPSILON) / (1 - DOT_EPSILON), 0, 1);
9393
float distanceAttenuation = clamp(1 - (linearDepth - START_FADE_DISTANCE) / (MAX_DISTANCE - START_FADE_DISTANCE), 0, 1);
9494
result = projectorColor * dotAttenuation * distanceAttenuation;
@@ -98,7 +98,7 @@ bool getProjectorColor(vec3 worldPos, vec3 worldNormal,
9898
}
9999

100100
void main() {
101-
float depth = texture2D(MainCameraDepth, texCoord).r;
101+
float depth = texture(MainCameraDepth, texCoord).r;
102102

103103
// Check for no hit, for early exit.
104104
if (depth >= 1) {

0 commit comments

Comments
 (0)