Perlin noise is a type of gradient noise used by visual effects artists to increase the appearance of realism in computer graphics. The Perlin Noise texture feature in Director 12 lets you create the perlin noise image as a texture directly inside the 3D world.
Prior to Adobe Director 12, you had to generate the noise image in 2D and pass it on to the 3D texture every time the noise image changed.
pnt = 3dMember.newtexture(texname, #perlinNoiseTexture, width, height, baseX, baseY, numOctaves, randomSeed, bStitch, bFractalNoise)
3D Perlin noise properties are similar to the ones for 2D Perlin noise feature. See this article for more information.
The following additional parameters are also available with the Perlin noise feature:
- StartColor and EndColor: Based on the value of the noise, a colour is interpolated in the said range between the startColor and endColor values.
- RenderAsAlpha: It can assume a Boolean value. When "renderNoiseAsAlpha" is false, it returns the interpolated color between the "startColor" and "endColor" based on the noise value at that pixel. When "renderNoiseAsAlpha" is true, it returns the "startColor" as rgb and noise value as the alpha of the pixel. "endColor" value is ignored in this case.
After setting the Perlin noise properties, you can render the noise to the Perlin noise texture using the following function:
Pnt=member(2).newtexture("Perlin_text",perlinNoiseTexture,128,128,30,30,3,2,0,0) pnt.startcolor=color(0,255,0) pnt.endcolor=color(0,0,255) pnt.renderNoiseAsAlpha=1
After the noise is rendered as Perlin noise texture, you can use this texture as any other texture in the 3D world.
This feature lets you create cubemap textures as render targets. All the 6 faces of the cubemap can now be used as individual render-to-texture targets. This allows for more advanced effects such as dynamic reflections.
pnt = 3dMember.newtexture(texname, #cubemapRenderTexture, width, height, face1, face2, face3, face4, face5, face6)
Face1, face2… face6 can be images or bitmap cast members. The texture can also be created without specifying any faces, as
pnt = 3dMember.newtexture(texname, #cubemapRenderTexture, width, height)
3dMember.rendertocubemap ( pCubeTexture, camera1, camera2, camera3, camera4, camera5, camera6 ) 3dMember.rendertocubemap ( pCubeTexture, faceNumber, camera6 ) 3dMember.rendertocubemap ( pCubeTexture, faceNumber, renderTexture)
If you are using Lingo, you can choose to update only the required face(s) of the cubemap, since rendering is a performance-heavy operation.
The last form is used to render to both the cube face and the renderTexture specified, which allows for accessing the image rendered through lingo.
Director 12 now extends support for the Apple PVR texture compression (PVRTC) format. PVRTC is a compressed texture that is used across all generations of iPod Touch, iPhone, and iPad devices. You can enable PVRTC for movies or games created in Adobe Director 12. For more information on PVRTC, refer to this wiki page.
Path = themoviepath&”texname.pvr” pvrTex = w3d.newtexture (“pvrTex1”, #pvrTexture, path) pvrTex.pvrPath = path
Ensure that you set the texture quality to #low. However, this does not affect the usage of mipmaps. For textures that contain mipmaps, they are still used despite setting the texture quality as #low.