News Overview SceneEngine Downloads VideoTutorials Main Page SourceForge Get Involved Bookmark and Share
See also :
Previous : Modifiers

UVAtlasModifier

Contents


Image:UVAtlas_modifier.jpg

UV Atlas is a Direct3D API that automatically generates an optimal, non-overlapping texture atlas. The UV Atlas SceneEngine modifier implements an easy to use interface to Direct3D's UV Atlas. The UV Atlas Modifier supports TriMesh and PolyMesh objects.

UVAtlas is available only for Microsoft Windows based systems.

CrackArt

UV Atlas is an object modifier that can be applied to geometric objects that support UVW meshes. It is accessible from the Control Panel Objects Page.

Image:Crackart_modifiers_uvatlas.jpg

Mini Tutorial

UV Atlas mini tutorial

ScEngLua

Class name

UVAtlasModifier

Partitioning Attributes

  • partition_type : Integer. The type of partition as defined in D3DXUVAtlasPartition dwOptions
  • max_charts : Integer. The maximum number of charts to partition the mesh into. See remarks about the partitioning modes. Use 0 to tell D3DX that the atlas should be parameterized based on stretch.
  • max_stretch : Float. The amount of stretching allowed. 0 means no stretching is allowed, 1 means any amount of stretching can be used.

Packing Attributes

  • width : Integer. Texture width.
  • height : Integer. Texture height.
  • gutter : Float. The minimum distance, in texels, between two charts on the atlas. The gutter is always scaled by the width; so, if a gutter of 2.5 is used on a 512x512 texture, then the minimum distance between two charts is 2.5 / 512.0 texels.

Output Attributes

  • uvw_mesh_id : Integer. The id of the uvw mesh to set.

Sample Script that applies a UVAtlasModifier

sceng.OpenScene( "scenes/skull.sceng" )
target = sceng.GetNode( "Skull LP" )
 
uvatlas_mod = sceng.UVAtlasModifier()
uvatlas_mod:Set( "gutter", 30.0 )
sceng.AddModifier( target, uvatlas_mod )

ScEngSDK

UV Atlas Modifier is a SceneEngine plugin. It is implemente in:

ScEngPlugins/ScEngUVAtlas

Development Info

Known issues

The sceng_uvatlas.dll plugin fails to be loaded by lua5.1.exe. The issue is that DirectX fails to create the device at Direct3DCreate9 or CreateDevice.

Things to do

Apply only partitionint or packing.

Views