|
@@ -25,11 +25,11 @@ class CubeCopy extends ScreenFx<CubeCopyShader> {
|
|
super(new CubeCopyShader());
|
|
super(new CubeCopyShader());
|
|
}
|
|
}
|
|
|
|
|
|
- public function apply( from, to, ?blend : h3d.mat.BlendMode ) {
|
|
|
|
|
|
+ public function apply( from, to, ?blend : h3d.mat.BlendMode, mip : Int = 0 ) {
|
|
shader.texture = from;
|
|
shader.texture = from;
|
|
for(i in 0 ... 6){
|
|
for(i in 0 ... 6){
|
|
if( to != null )
|
|
if( to != null )
|
|
- engine.pushTarget(to, i);
|
|
|
|
|
|
+ engine.pushTarget(to, i, mip);
|
|
shader.mat = cubeDir[i];
|
|
shader.mat = cubeDir[i];
|
|
pass.setBlendMode(blend == null ? None : blend);
|
|
pass.setBlendMode(blend == null ? None : blend);
|
|
render();
|
|
render();
|
|
@@ -39,15 +39,15 @@ class CubeCopy extends ScreenFx<CubeCopyShader> {
|
|
shader.texture = null;
|
|
shader.texture = null;
|
|
}
|
|
}
|
|
|
|
|
|
- public static function run( from : h3d.mat.Texture, to : h3d.mat.Texture, ?blend : h3d.mat.BlendMode ) {
|
|
|
|
|
|
+ public static function run( from : h3d.mat.Texture, to : h3d.mat.Texture, ?blend : h3d.mat.BlendMode, mip : Int = 0 ) {
|
|
var engine = h3d.Engine.getCurrent();
|
|
var engine = h3d.Engine.getCurrent();
|
|
- if( to != null && from != null && (blend == null || blend == None) && engine.driver.copyTexture(from, to) )
|
|
|
|
|
|
+ if( to != null && from != null && (blend == null || blend == None) && mip == 0 && engine.driver.copyTexture(from, to) )
|
|
return;
|
|
return;
|
|
var inst : CubeCopy = @:privateAccess engine.resCache.get(CubeCopy);
|
|
var inst : CubeCopy = @:privateAccess engine.resCache.get(CubeCopy);
|
|
if( inst == null ) {
|
|
if( inst == null ) {
|
|
inst = new CubeCopy();
|
|
inst = new CubeCopy();
|
|
@:privateAccess engine.resCache.set(CubeCopy, inst);
|
|
@:privateAccess engine.resCache.set(CubeCopy, inst);
|
|
}
|
|
}
|
|
- return inst.apply(from, to, blend);
|
|
|
|
|
|
+ return inst.apply(from, to, blend, mip);
|
|
}
|
|
}
|
|
}
|
|
}
|