[SOLVED] Skybox wont not smooth.

Software: Away3D 4.x

netgrind, Newbie
Posted: 04 December 2013 02:55 PM   Total Posts: 5

I’m trying to create a skybox that looks super pixely but setting sky.material.smooth to false seems to not affect the skyboxes smoothness.

The image is just a simple 32x32 png of a dithered gradient.

The skybox code follows (4.1.1)

var skyW:Bitmap = new skyWall();
skyW.smoothing false;   
var 
sky:SkyBox = new SkyBox(new BitmapCubeTexture(skyW.bitmapDataskyW.bitmapData,new skyCeil().bitmapData, new skyFloor().bitmapDataskyW.bitmapDataskyW.bitmapData));
SkyBoxMaterial(sky.material).smooth false

Anyone have a clue what might be up?
Each image is embeded like so

[Embed(source "../../lib/skybox/dezertOutpost/wall.png"mimeType 'image/png')]public var skyWall:Class; 

Thanks

   

netgrind, Newbie
Posted: 04 December 2013 03:04 PM   Total Posts: 5   [ # 1 ]

I just noticed my version was out of date and I updated to 4.1.4. Still no luck.

   

Avatar
GoroMatsumoto, Sr. Member
Posted: 04 December 2013 03:15 PM   Total Posts: 166   [ # 2 ]

You can’t set interpolation method of sampling by that smooth property.
the smooth is just a property of super class MaterialBase.

See line 81 of SkyBoxPass class.
https://github.com/away3d/away3d-core-fp11/blob/master/src/away3d/materials/passes/SkyBoxPass.as

return "tex ft0, v0, fs0 <cube," format "linear,clamp" mip ">        \n" 

For pixelation, it have to use “nearest” instead of “linear”.

return "tex ft0, v0, fs0 <cube," format "nearest,clamp" mip ">        \n" 

You can make clones of your own skybox classes,
and modify this line.
Like below:
SkyBoxPixelMaterial.as
SkyBoxPixelPass.as

And,

sky:SkyBox = new SkyBox(null);
sky.material = new SkyBoxPixelMaterial(cubeMap); 

Of course, you can clone SkyBox class too.

sky:PixelSkyBox = new PixelSkyBox(cubeMap); 

 

   

netgrind, Newbie
Posted: 04 December 2013 03:25 PM   Total Posts: 5   [ # 3 ]

Okay rad. That almost worked perfectly. I just had to edit SkyBox like so

private var _material:MaterialBase;
...
public function 
set material(value:MaterialBase):void
{
 _material 
value;

Thanks a bunch!

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X