Skip to content

Commit

Permalink
fix: 1711
Browse files Browse the repository at this point in the history
  • Loading branch information
drcmda committed Nov 9, 2023
1 parent 1169c02 commit 5846a4e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/core/Cloud.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as React from 'react'
import {
REVISION,
DynamicDrawUsage,
Color,
Group,
Expand Down Expand Up @@ -102,6 +103,7 @@ export const Clouds = /* @__PURE__ */ React.forwardRef<Group, CloudsProps>(
return class extends (material as typeof Material) {
constructor() {
super()
const opaque_fragment = parseInt(REVISION.replace(/\D+/g, '')) >= 154 ? 'opaque_fragment' : 'output_fragment'
this.onBeforeCompile = (shader) => {
shader.vertexShader =
`attribute float opacity;
Expand All @@ -117,8 +119,8 @@ export const Clouds = /* @__PURE__ */ React.forwardRef<Group, CloudsProps>(
`varying float vOpacity;
` +
shader.fragmentShader.replace(
'#include <output_fragment>',
`#include <output_fragment>
`#include <${opaque_fragment}>`,
`#include <${opaque_fragment}>
gl_FragColor = vec4(outgoingLight, diffuseColor.a * vOpacity);
`
)
Expand Down

1 comment on commit 5846a4e

@vercel
Copy link

@vercel vercel bot commented on 5846a4e Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.