Postprocessing: Cannot access material property in ShaderPass

Created on 20 Feb 2019  路  3Comments  路  Source: vanruesc/postprocessing

I used to be able to access and manipulate the ShaderPass material (e.g. changing uniforms)

I.e. I could access aShaderPass.material. In the new version of processing (5.6.0) I could access it using version 4.5.0.

The use case I have is that I need to change material uniforms at runtime when scroll position changes.

question

All 3 comments

Hi,

the material accessor was replaced by the method getFullscreenMaterial in version 5. You can read more about this change in the release notes of 4.8.0 and 5.0.0.

So instead of doing

const uniforms = myShaderPass.material.uniforms;

you do

const uniforms = myShaderPass.getFullscreenMaterial().uniforms;

Thanks @vanruesc. I've also found that

const uniforms = myShaderPass.quad.material.uniforms;

Also works.

Please note that Pass.quad is a private field which means that it may change without warning in future releases.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brunoimbrizi picture brunoimbrizi  路  4Comments

marcofugaro picture marcofugaro  路  4Comments

emmelleppi picture emmelleppi  路  4Comments

thewizardwand picture thewizardwand  路  3Comments

dghez picture dghez  路  4Comments