I want to control the resolution of ‘Realtime reflection’
(as taken from two different examples on the Playcanvas-websources [one with boxes spheres flying around, which I cannot find again - and another one; cf bottom one] )
Here is the result of the reflection, but with quite a low resolution on the glass of the pavillion (notice the hi-res iron pole upon the panoramic image versus the low-res reflection of the pole itself here):
For once / sometimes I can reveal the project itself - as such here it is:
https://playcanvas.com/editor/scene/1352723
- and I have already been tampering with these scripts without luck:
PS: There is also a tutorial-example called " Planar Mirror Reflection".
But this tend to make the ‘glass’-like surface darker (as if it had a dark sun-screen plast upon it - have tried several things to make it right → for good order, made as a separate issue/post [ (Controlling 'Realtime reflection' - second issue; "Planar Mirror Reflection" only) ])
There’s a similar thread on this where there should be an API for you to control the resolution environment atlas: Prefiltered dds resolution issue - #9 by slimbuck
1 Like
ok thanks, but found the solution myself (had already tried different approaches earlier - weeks ago)
bit of coincedence that this was the solution - but at CubemapRenderer.js:
// limit maximum texture size
var resolution = Math.min(this.resolution, this.app.graphicsDevice.maxCubeMapSize);
// Create cubemap render target with specified resolution and mipmap generation
this.cubeMap = new pc.Texture(this.app.graphicsDevice, {
width: resolution,
height: resolution,
format: pc.PIXELFORMAT_R8_G8_B8_A8,
cubemap: true,
mipmaps: this.mipmaps,
minFilter: pc.FILTER_LINEAR_MIPMAP_LINEAR,
magFilter: pc.FILTER_LINEAR
});
has to be (off course without the limit - and with the max 6th of my equirect 2x1 image of 8192px x 4096 px => 2048 px at both sides):
// limit maximum texture size
var resolution = Math.min(this.resolution, this.app.graphicsDevice.maxCubeMapSize);
// Create cubemap render target with specified resolution and mipmap generation
this.cubeMap = new pc.Texture(this.app.graphicsDevice, {
width: 2048,
height: 2048,
format: pc.PIXELFORMAT_R8_G8_B8_A8,
cubemap: true,
mipmaps: this.mipmaps,
minFilter: pc.FILTER_LINEAR_MIPMAP_LINEAR,
magFilter: pc.FILTER_LINEAR
});