-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add envMap property in the mesh standard material demo, fix envmap
- Loading branch information
1 parent
a5e2b36
commit 3b7f8e1
Showing
15 changed files
with
128 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { | ||
MeshPhysicalMaterial, | ||
MeshStandardMaterial, | ||
MeshStandardMaterialParameters, | ||
WebGLProgramParametersWithUniforms, | ||
WebGLRenderer, | ||
} from 'three'; | ||
import local_particle_physics_vert from '../shaders/local_particle_physics_vert.glsl'; | ||
import particle_physics_frag from '../shaders/particle_physics_frag.glsl'; | ||
|
||
export class ParticleMeshStandardMaterial extends MeshStandardMaterial { | ||
constructor(parameters: MeshStandardMaterialParameters) { | ||
super(parameters); | ||
} | ||
|
||
onBeforeCompile(parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer) { | ||
super.onBeforeCompile(parameters, renderer); | ||
parameters.vertexShader = local_particle_physics_vert; | ||
parameters.fragmentShader = particle_physics_frag; | ||
} | ||
} | ||
|
||
export class ParticleMeshPhysicsMaterial extends MeshPhysicalMaterial { | ||
constructor(parameters: MeshStandardMaterialParameters) { | ||
super(parameters); | ||
} | ||
|
||
onBeforeCompile(parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer) { | ||
super.onBeforeCompile(parameters, renderer); | ||
parameters.vertexShader = local_particle_physics_vert; | ||
parameters.fragmentShader = particle_physics_frag; | ||
} | ||
} |