I just want to know is there any way to select the mipmap level for the prefiltered cubemap for interior (not for the skybox in the rendering settings)
What I want to achieve is to set different mipmap levels for different materials (mirror refection with highest level, or floor reflection with low level, etc) I hope I make my point clear.
And here is the generic reflectionCube shader chunk:
It uses a plain version of the fixSeams method, but there is an overloaded method that takes as a second parameter the mipmapIndex:
I haven’t tried it myself but I am thinking potentially you can add a custom uniform to inject your desired mimapIndex to the reflectionCube shader chunk and update the fixSeams() method to use it.
var ShaderManager = pc.createScript('shaderManager');
ShaderManager.attributes.add('mipmapIndexProp', { type: 'number', default:3 });
// initialize code called once per entity
ShaderManager.prototype.initialize = function() {
var mipmapShader = this.app.assets.find("SetMipMap").resource;
var meshes = this.entity.model.model.meshInstances;
var dinnerTableMesh = meshes[23];
//console.log(meshes[23].node.name);
var mat = dinnerTableMesh.material;
mat.chunks.reflectionCube = mipmapShader;
mat.setParameter("mipmapIndex", this.mipmapIndexProp);
mat.update();
};
There is no error in the debugger console. But upon changing to any mipmapIndexProp value, the result doesnt create the correct type of blurry or clear cubemap, unlike the setting for skybox.