• Content count

  • Joined

  • Last visited

  1. Custom texture mipmaps for roughness

    Something like that. Thanks for the xamples, but I've managed to do it using cube maps IBLBaker and textureCubeLodEXT
  2. Custom texture mipmaps for roughness

    Found this very helpful. I've also enabled the EXT_shader_texture_lod extension (as Webgl doesn't support textureCubeLod) and I now use textureCubeLodEXT instead of textureCube with a bias. I've taken a look at the default shader and I think it would be better to also use textureCubeLodEXT instead of textureCube for roughness. textureCube creates artifacts and changes with distance. more info here: @Deltakosh
  3. Is there a way to generate custom mipmaps for a texture and save it? For instance, Unity preblurs the mips of a cube map (using specular convolution) in order to accurately simulate roughness.
  4. Access texcoord1 (or more) as attribute

    I only tried uv, uv0, and uv1. I've just tried uv2 and it worked, thanks
  5. Can't change the TextureFormat for a RenderTargetTexture

    Done, here's the issue
  6. Hello, Is there a way to access the texcoord1 in the shader as an attribute? I know I can access texcoord0 using attribute vec2 uv; but uv0/uv1/uv2 etc don't seem to do anything. This is trivial for using lightmaps
  7. Can't change the TextureFormat for a RenderTargetTexture

    Can I use raw textures as rendertargets? if not, it doesn't help me much
  8. Hey guys, I want to create a custom RenderTargetTexture of type BABYLON.Engine.TEXTUREFORMAT_LUMINANCE but it doesn't work. here's my code: textureFormat is always 5 (probably TEXTUREFORMAT_RGBA), regardless of what I set it to be. // Render target var renderTarget = new BABYLON.RenderTargetTexture( "depth", 128, // res scene, false, // generateMipMaps true, // doNotChangeAspectRatio BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT, // type false, // isCube BABYLON.Texture.BILINEAR_SAMPLINGMODE, // samplingMode false, // generateDepthBuffer false, // generateStencilBuffer false); //isMulti renderTarget.noMipmap = true; renderTarget.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE; renderTarget.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE; renderTarget.wrapR = BABYLON.Texture.CLAMP_ADDRESSMODE; renderTarget.textureFormat = BABYLON.Engine.TEXTUREFORMAT_LUMINANCE; renderTarget.hasAlpha = false; renderTarget.gammaSpace= false; ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// My wild guess is that the constructor doesn't pass textureFormat to _renderTargetOptions this._renderTargetOptions = { generateMipMaps: generateMipMaps, type: type, samplingMode: samplingMode, generateDepthBuffer: generateDepthBuffer, generateStencilBuffer: generateStencilBuffer };