07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADOBE DIRECTOR BASICS<br />

3D: Controlling appearance<br />

Texture renderFormat<br />

Textures give precision and detail to the rendering of an image. However, they require significantly more space in the<br />

computer's video Random Access Memory than 2D images.<br />

A 2D image normally appears flat on the screen with one pixel of memory space corresponding to one pixel of screen<br />

space. A 3D texture may be placed on a surface at any angle to the camera. A texture for a wall, for example may need<br />

to be very detailed when it is viewed from directly in front and close up. If the wall is in the distance, or seen at a steeply<br />

foreshortened angle, very few pixels on the screen actually uses the pixels stored in the texture. Only a small proportion<br />

of the information stored in textures loaded into video RAM is used on any one frame. The graphics card used to<br />

render an image to your client's monitor will have a finite capacity for textures. You may want to exploit the available<br />

space to the best effect.<br />

textureRenderFormat<br />

You can set the texture.renderFormat property individually for each texture. Alternatively, you can set a default value<br />

for all textures, using getRendererServices().textureRenderFormat.<br />

For the best graphic quality, you can choose one of the 32-bit formats (#rgba8880 or #rgba8880). For more economic<br />

use of the video RAM, you can use one of the 16-bit formats (#rgba5550, #rgba5650, #rgba5551 or #rgba4444). Any<br />

texture whose renderFormat is set to #default will use the value set by getRendererServices().textureRenderFormat.<br />

You can alter this value at runtime. See “Texture properties and method” on page 147for a discussion of the<br />

scaleDown() method and for alternative techniques for finding the right balance between texture detail and size.<br />

Antialiasing<br />

See “Antialiasing” on page 390.<br />

Render to texture<br />

Let us consider that you are developing a car-racing game in <strong>Director</strong>. You need the driver of the car to see the other<br />

cars and the 'scene' behind the car in the side rear-view mirrors.<br />

The easiest way to achieve this is to use the render to texture feature. This feature helps you render objects with specific<br />

'textures'during run-time and display the rendered scene on your users' devices faster.You can define the 'texture' using<br />

a camera view. Everything that is within the camera view is considered as a 'texture', and the whole 'view' is applied to<br />

the chosen object. In the car-racing example, you can place the camera behind the car. As the car moves, the camera<br />

captures the view behind the car, and this view is applied as a 'texture' to the rear-view mirrors.<br />

When you use camera views for render to texture, the image is copied onto the video RAM and then in the Lingo code,<br />

and is then applied to the chosen object at run-time.<br />

You can render the objects quickly by applying the image to the object directly from the video RAM. To do so, you<br />

need to set the updateRTImageOnRender property to false.<br />

The following are the typical steps that you need to follow for using render to texture:<br />

1 Create a new texture with type rendertexture:<br />

member(whichCastmember).newTexture(newTextureName {,#typeIndicator, rendTexWidth,<br />

rendTexHeight})<br />

The updateRTImageOnRender property is set to 'True' by default. This means, <strong>Director</strong> copies the texture image<br />

from the video RAM to the Lingo code and then applies to the target object.<br />

If you want to apply the texture directly from video RAM to the target object, set the updateRTImageOnRender<br />

property to 'False'.<br />

Last updated 8/26/2011<br />

157

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!