|
@@ -576,6 +576,10 @@ class GlDriver extends Driver {
|
|
|
gl.texParameteri(mode, GL.TEXTURE_WRAP_S, w);
|
|
|
gl.texParameteri(mode, GL.TEXTURE_WRAP_T, w);
|
|
|
}
|
|
|
+ if( t.lodBias != t.t.bias ) {
|
|
|
+ t.t.bias = t.lodBias;
|
|
|
+ gl.texParameterf(pt.mode, GL.TEXTURE_LOD_BIAS, t.lodBias);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -828,7 +832,7 @@ class GlDriver extends Driver {
|
|
|
discardError();
|
|
|
var tt = gl.createTexture();
|
|
|
var bind = getBindType(t);
|
|
|
- var tt : Texture = { t : tt, width : t.width, height : t.height, internalFmt : GL.RGBA, pixelFmt : GL.UNSIGNED_BYTE, bits : -1, bind : bind #if multidriver, driver : this #end };
|
|
|
+ var tt : Texture = { t : tt, width : t.width, height : t.height, internalFmt : GL.RGBA, pixelFmt : GL.UNSIGNED_BYTE, bits : -1, bind : bind, bias : 0, #if multidriver, driver : this #end };
|
|
|
switch( t.format ) {
|
|
|
case RGBA:
|
|
|
// default
|
|
@@ -1486,7 +1490,7 @@ class GlDriver extends Driver {
|
|
|
gl.framebufferTextureLayer(GL.FRAMEBUFFER, GL.COLOR_ATTACHMENT0, tex.t.t, mipLevel, layer);
|
|
|
else
|
|
|
gl.framebufferTexture2D(GL.FRAMEBUFFER, GL.COLOR_ATTACHMENT0, tex.flags.has(Cube) ? CUBE_FACES[layer] : GL.TEXTURE_2D, tex.t.t, mipLevel);
|
|
|
-
|
|
|
+
|
|
|
if( tex.depthBuffer != null ) {
|
|
|
// Depthbuffer and stencilbuffer are combined in one buffer, created with GL.DEPTH_STENCIL
|
|
|
if(tex.depthBuffer.hasStencil() && tex.depthBuffer.format == Depth24Stencil8) {
|
|
@@ -1494,7 +1498,7 @@ class GlDriver extends Driver {
|
|
|
} else {
|
|
|
gl.framebufferRenderbuffer(GL.FRAMEBUFFER, GL.DEPTH_STENCIL_ATTACHMENT, GL.RENDERBUFFER,null);
|
|
|
gl.framebufferRenderbuffer(GL.FRAMEBUFFER, GL.DEPTH_ATTACHMENT, GL.RENDERBUFFER, @:privateAccess tex.depthBuffer.b.r);
|
|
|
- gl.framebufferRenderbuffer(GL.FRAMEBUFFER, GL.STENCIL_ATTACHMENT, GL.RENDERBUFFER,tex.depthBuffer.hasStencil() ? @:privateAccess tex.depthBuffer.b.r : null);
|
|
|
+ gl.framebufferRenderbuffer(GL.FRAMEBUFFER, GL.STENCIL_ATTACHMENT, GL.RENDERBUFFER,tex.depthBuffer.hasStencil() ? @:privateAccess tex.depthBuffer.b.r : null);
|
|
|
}
|
|
|
} else {
|
|
|
gl.framebufferRenderbuffer(GL.FRAMEBUFFER, GL.DEPTH_STENCIL_ATTACHMENT, GL.RENDERBUFFER,null);
|