-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TSL: Vertex shader revision (#30108)
* vertex shader revision * revision * cleanup * Update Three.TSL.js * Update webgpu_instance_sprites.jpg * Update webgpu_tsl_galaxy.jpg * renames
- Loading branch information
Showing
13 changed files
with
66 additions
and
82 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
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
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 |
---|---|---|
@@ -1,42 +1,4 @@ | ||
import TempNode from '../core/TempNode.js'; | ||
import { cameraProjectionMatrix } from './Camera.js'; | ||
import { positionLocal } from './Position.js'; | ||
import { nodeProxy, varying } from '../tsl/TSLBase.js'; | ||
import { modelViewMatrix } from './ModelNode.js'; | ||
import { positionView } from './Position.js'; | ||
|
||
class ModelViewProjectionNode extends TempNode { | ||
|
||
static get type() { | ||
|
||
return 'ModelViewProjectionNode'; | ||
|
||
} | ||
|
||
constructor( positionNode = null ) { | ||
|
||
super( 'vec4' ); | ||
|
||
this.positionNode = positionNode; | ||
|
||
} | ||
|
||
setup( builder ) { | ||
|
||
if ( builder.shaderStage === 'fragment' ) { | ||
|
||
return varying( builder.context.mvp ); | ||
|
||
} | ||
|
||
const position = this.positionNode || positionLocal; | ||
const viewMatrix = builder.renderer.nodes.modelViewMatrix || modelViewMatrix; | ||
|
||
return cameraProjectionMatrix.mul( viewMatrix ).mul( position ); | ||
|
||
} | ||
|
||
} | ||
|
||
export default ModelViewProjectionNode; | ||
|
||
export const modelViewProjection = /*@__PURE__*/ nodeProxy( ModelViewProjectionNode ); | ||
export const modelViewProjection = /*@__PURE__*/ cameraProjectionMatrix.mul( positionView ).varying( 'v_modelViewProjection' ); |
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