Difference between revisions of "Horde3D Wiki:HOWTO"

From Horde3D Wiki
Jump to: navigation, search
m
Line 9: Line 9:
  
 
Anti-aliasing can only be enabled for render targets. The RenderTarget element used in Pipeline resources has an attribute '''maxSamples''' which defines the maximum number of samples used for MSAA. The actual number of samples is controlled by the engine option '''SampleCount'''. This makes it possible to control the anti-aliasing quality from the application. If SampleCount is set to zero, MSAA is disabled. Note that the hardware needs to support the EXT_framebuffer_multisample extension in order for the MSAA to work.
 
Anti-aliasing can only be enabled for render targets. The RenderTarget element used in Pipeline resources has an attribute '''maxSamples''' which defines the maximum number of samples used for MSAA. The actual number of samples is controlled by the engine option '''SampleCount'''. This makes it possible to control the anti-aliasing quality from the application. If SampleCount is set to zero, MSAA is disabled. Note that the hardware needs to support the EXT_framebuffer_multisample extension in order for the MSAA to work.
 +
 +
== How to get the size of a loaded texture ==
 +
 +
To query the dimensions of a loaded texture you can call
 +
{{CppSourceCode|
 +
description= C++ Code|
 +
code=
 +
<source lang="cpp" line="1">
 +
int width = Horde3D::getResourceParami( texResHandle, TextureResParams::Width );
 +
int height = Horde3D::getResourceParami( texResHandle, TextureResParams::Height );
 +
</source>}}

Revision as of 16:06, 15 May 2009

The HOWTO contains quick answers for smaller problems.



How to enable anti-aliasing (MSAA)

Anti-aliasing can only be enabled for render targets. The RenderTarget element used in Pipeline resources has an attribute maxSamples which defines the maximum number of samples used for MSAA. The actual number of samples is controlled by the engine option SampleCount. This makes it possible to control the anti-aliasing quality from the application. If SampleCount is set to zero, MSAA is disabled. Note that the hardware needs to support the EXT_framebuffer_multisample extension in order for the MSAA to work.

How to get the size of a loaded texture

To query the dimensions of a loaded texture you can call

C++ Code
int width = Horde3D::getResourceParami( texResHandle, TextureResParams::Width );
int height = Horde3D::getResourceParami( texResHandle, TextureResParams::Height );