PMREM and ShaderMaterial

Hi there,

Do you know any examples of how to implement the “roughness” property on a shaderMaterial similar to this example?

Am I correct into looking stuff like this?


I’m afraid it’s not 100% clear what you want to do. Do you want to use roughness/metalness material parameters for a custom shader material? I mean an instance of THREE.ShaderMaterial or THREE.RawShaderMaterial?

Yes, I’m trying to write my own THREE.ShaderMaterial and I want to add a similar “roughness” parameter. Meanwhile I realised that all the related JS files (HDRCubeTextureLoader.js, PMREMCubeUVPacker.js, PMREMGenerator.js, RGBELoader.js) require the threejs module, so I just detached them (is that a bad practice btw?).

In case anyone interested, I just found this example, so I think I’ll manage to figure it out from here.

1 Like

For anyone still trying to implement cubemap textures for envmaps in shadermaterials here is an updated version of the codepen above, since you no longer need to use the extension for LOD.

Many thanks for the reply win! :slight_smile:
Do you know how you can improve the quality in these areas?
Is this only related to the quality of the dds?