API Reference

Class List

pc

Root namespace for the PlayCanvas Engine

Summary

Static Properties

ADDRESS_CLAMP_TO_EDGEClamps texture coordinate to the range 0 to 1.
ADDRESS_MIRRORED_REPEATTexture coordinate to be set to the fractional part if the integer part is even; if the integer part is odd, then the texture coordinate is set to 1 minus the fractional part.
ADDRESS_REPEATIgnores the integer part of texture coordinates, using only the fractional part.
ASPECT_AUTOAutomatically set aspect ratio to current render target's width divided by height.
ASPECT_MANUALUse the manual aspect ratio value.
ASSET_ANIMATIONAsset type name for animation.
ASSET_AUDIOAsset type name for audio.
ASSET_CSSAsset type name for CSS.
ASSET_CUBEMAPAsset type name for cubemap.
ASSET_HTMLAsset type name for HTML.
ASSET_IMAGEAsset type name for image.
ASSET_JSONAsset type name for json.
ASSET_MATERIALAsset type name for material.
ASSET_MODELAsset type name for model.
ASSET_SCRIPTAsset type name for script.
ASSET_SHADERAsset type name for shader.
ASSET_TEXTAsset type name for text.
ASSET_TEXTUREAsset type name for texture.
BAKE_COLORSingle color lightmap.
BAKE_COLORDIRSingle color lightmap + dominant light direction (used for bump/specular).
BLENDEQUATION_ADDAdd the results of the source and destination fragment multiplies.
BLENDEQUATION_MAXUse the largest value.
BLENDEQUATION_MINUse the smallest value.
BLENDEQUATION_REVERSE_SUBTRACTReverse and subtract the results of the source and destination fragment multiplies.
BLENDEQUATION_SUBTRACTSubtract the results of the source and destination fragment multiplies.
BLENDMODE_DST_ALPHAMultiply all fragment components by the alpha value of the destination fragment.
BLENDMODE_DST_COLORMultiply all fragment components by the components of the destination fragment.
BLENDMODE_ONEMultiply all fragment components by one.
BLENDMODE_ONE_MINUS_DST_ALPHAMultiply all fragment components by one minus the alpha value of the destination fragment.
BLENDMODE_ONE_MINUS_DST_COLORMultiply all fragment components by one minus the components of the destination fragment.
BLENDMODE_ONE_MINUS_SRC_ALPHAMultiply all fragment components by one minus the alpha value of the source fragment.
BLENDMODE_ONE_MINUS_SRC_COLORMultiply all fragment components by one minus the components of the source fragment.
BLENDMODE_SRC_ALPHAMultiply all fragment components by the alpha value of the source fragment.
BLENDMODE_SRC_ALPHA_SATURATEMultiply all fragment components by the alpha value of the source fragment.
BLENDMODE_SRC_COLORMultiply all fragment components by the components of the source fragment.
BLENDMODE_ZEROMultiply all fragment components by zero.
BLEND_ADDITIVEAdd the color of the source fragment to the destination fragment and write the result to the frame buffer.
BLEND_ADDITIVEALPHASame as pc.
BLEND_MAXMaximum color.
BLEND_MINMinimum color.
BLEND_MULTIPLICATIVEMultiply the color of the source fragment by the color of the destination fragment and write the result to the frame buffer.
BLEND_MULTIPLICATIVE2XMultiplies colors and doubles the result
BLEND_NONEDisable blending.
BLEND_NORMALEnable simple translucency for materials such as glass.
BLEND_PREMULTIPLIEDSimilar to pc.
BLEND_SCREENSofter version of additive
BLEND_SUBTRACTIVESubtract the color of the source fragment from the destination fragment and write the result to the frame buffer.
BLUR_BOXBox filter.
BLUR_GAUSSIANGaussian filter.
BODYTYPE_DYNAMICRigid body is simulated according to applied forces.
BODYTYPE_KINEMATICRigid body has infinite mass and does not respond to forces but can still be moved by setting their velocity or position.
BODYTYPE_STATICRigid body has infinite mass and cannot move.
BUFFER_DYNAMICThe data store contents will be modified repeatedly and used many times.
BUFFER_GPUDYNAMICThe data store contents will be modified repeatedly on the GPU and used many times.
BUFFER_STATICThe data store contents will be modified once and used many times.
BUFFER_STREAMThe data store contents will be modified once and used at most a few times.
BUTTON_TRANSITION_MODE_SPRITE_CHANGESpecifies different sprites for the hover, pressed and inactive states.
BUTTON_TRANSITION_MODE_TINTSpecifies different color tints for the hover, pressed and inactive states.
CLEARFLAG_COLORClear the color buffer.
CLEARFLAG_DEPTHClear the depth buffer.
CLEARFLAG_STENCILClear the stencil buffer.
CUBEFACE_NEGXThe negative X face of a cubemap.
CUBEFACE_NEGYThe negative Y face of a cubemap.
CUBEFACE_NEGZThe negative Z face of a cubemap.
CUBEFACE_POSXThe positive X face of a cubemap.
CUBEFACE_POSYThe positive Y face of a cubemap.
CUBEFACE_POSZThe positive Z face of a cubemap.
CUBEPROJ_BOXThe cube map is box-projected based on a world space axis-aligned bounding box.
CUBEPROJ_NONEThe cube map is treated as if it is infinitely far away.
CULLFACE_BACKTriangles facing away from the view direction are culled.
CULLFACE_FRONTTriangles facing the view direction are culled.
CULLFACE_FRONTANDBACKTriangles are culled regardless of their orientation with respect to the view direction.
CULLFACE_NONENo triangles are culled.
CURVE_CARDINALA cardinal spline interpolation scheme.
CURVE_CATMULLA Catmull-Rom spline interpolation scheme.
CURVE_LINEARA linear interpolation scheme.
CURVE_SMOOTHSTEPA smooth step interpolation scheme.
CURVE_SPLINECardinal spline interpolation scheme.
CURVE_STEPA stepped interpolater, free from the shackles of blending.
DISTANCE_EXPONENTIALExponential distance model
DISTANCE_INVERSEInverse distance model
DISTANCE_LINEARLinear distance model
ELEMENTTYPE_GROUPA pc.ElementComponent that contains child pc.ElementComponents.
ELEMENTTYPE_IMAGEA pc.ElementComponent that displays an image.
ELEMENTTYPE_TEXTA pc.ElementComponent that displays text.
EMITTERSHAPE_BOXBox shape parameterized by emitterExtents.
EMITTERSHAPE_SPHERESphere shape parameterized by emitterRadius.
EVENT_KEYDOWNName of event fired when a key is pressed
EVENT_KEYUPName of event fired when a key is released
EVENT_MOUSEDOWNName of event fired when a mouse button is pressed
EVENT_MOUSEMOVEName of event fired when the mouse is moved
EVENT_MOUSEUPName of event fired when a mouse button is released
EVENT_MOUSEWHEELName of event fired when the mouse wheel is rotated
EVENT_TOUCHCANCELName of event fired when a touch point is interrupted in some way.
EVENT_TOUCHENDName of event fired when touch ends.
EVENT_TOUCHMOVEName of event fired when a touch moves.
EVENT_TOUCHSTARTName of event fired when a new touch occurs.
FILLMODE_FILL_WINDOWWhen resizing the window the size of the canvas will change to fill the window exactly.
FILLMODE_KEEP_ASPECTWhen resizing the window the size of the canvas will change to fill the window as best it can, while maintaining the same aspect ratio.
FILLMODE_NONEWhen resizing the window the size of the canvas will not change.
FILTER_LINEARBilinear filtering.
FILTER_LINEAR_MIPMAP_LINEARLinearly interpolate both the mipmap levels and between texels.
FILTER_LINEAR_MIPMAP_NEARESTUse the nearest neighbor after linearly interpolating between mipmap levels.
FILTER_NEARESTPoint sample filtering.
FILTER_NEAREST_MIPMAP_LINEARLinearly interpolate in the nearest mipmap level.
FILTER_NEAREST_MIPMAP_NEARESTUse the nearest neighbor in the nearest mipmap level.
FITTING_BOTHApply both STRETCH and SHRINK fitting logic where applicable.
FITTING_NONEDisable all fitting logic.
FITTING_SHRINKShrink child elements to fit the parent container
FITTING_STRETCHStretch child elements to fit the parent container
FOG_EXPFog rises according to an exponential curve controlled by a density value.
FOG_EXP2Fog rises according to an exponential curve controlled by a density value.
FOG_LINEARFog rises linearly from zero to 1 between a start and end depth.
FOG_NONENo fog is applied to the scene.
FRESNEL_NONENo Fresnel.
FRESNEL_SCHLICKSchlick's approximation of Fresnel.
FUNC_ALWAYSAlways pass.
FUNC_EQUALPass if (ref & mask) == (stencil & mask).
FUNC_GREATERPass if (ref & mask) > (stencil & mask).
FUNC_GREATEREQUALPass if (ref & mask) >= (stencil & mask).
FUNC_LESSPass if (ref & mask) < (stencil & mask).
FUNC_LESSEQUALPass if (ref & mask) <= (stencil & mask).
FUNC_NEVERNever pass.
FUNC_NOTEQUALPass if (ref & mask) != (stencil & mask).
GAMMA_NONENo gamma correction.
GAMMA_SRGBApply sRGB gamma correction.
GAMMA_SRGBFASTApply sRGB (fast) gamma correction.
GAMMA_SRGBHDRApply sRGB (HDR) gamma correction.
INDEXFORMAT_UINT1616-bit unsigned vertex indices.
INDEXFORMAT_UINT3232-bit unsigned vertex indices.
INDEXFORMAT_UINT88-bit unsigned vertex indices.
KEY_0
KEY_1
KEY_2
KEY_3
KEY_4
KEY_5
KEY_6
KEY_7
KEY_8
KEY_9
KEY_A
KEY_ADD
KEY_ALT
KEY_B
KEY_BACKSPACE
KEY_BACK_SLASH
KEY_C
KEY_CAPS_LOCK
KEY_CLOSE_BRACKET
KEY_COMMA
KEY_CONTEXT_MENU
KEY_CONTROL
KEY_D
KEY_DECIMAL
KEY_DELETE
KEY_DIVIDE
KEY_DOWN
KEY_E
KEY_END
KEY_ENTER
KEY_EQUAL
KEY_ESCAPE
KEY_F
KEY_F1
KEY_F10
KEY_F11
KEY_F12
KEY_F2
KEY_F3
KEY_F4
KEY_F5
KEY_F6
KEY_F7
KEY_F8
KEY_F9
KEY_G
KEY_H
KEY_HOME
KEY_I
KEY_INSERT
KEY_J
KEY_K
KEY_L
KEY_LEFT
KEY_M
KEY_META
KEY_MULTIPLY
KEY_N
KEY_NUMPAD_0
KEY_NUMPAD_1
KEY_NUMPAD_2
KEY_NUMPAD_3
KEY_NUMPAD_4
KEY_NUMPAD_5
KEY_NUMPAD_6
KEY_NUMPAD_7
KEY_NUMPAD_8
KEY_NUMPAD_9
KEY_O
KEY_OPEN_BRACKET
KEY_P
KEY_PAGE_DOWN
KEY_PAGE_UP
KEY_PAUSE
KEY_PERIOD
KEY_PRINT_SCREEN
KEY_Q
KEY_R
KEY_RETURN
KEY_RIGHT
KEY_S
KEY_SEMICOLON
KEY_SEPARATOR
KEY_SHIFT
KEY_SLASH
KEY_SPACE
KEY_SUBTRACT
KEY_T
KEY_TAB
KEY_U
KEY_UP
KEY_V
KEY_W
KEY_WINDOWS
KEY_X
KEY_Y
KEY_Z
LAYERID_DEPTHThe depth layer.
LAYERID_IMMEDIATEThe immediate layer.
LAYERID_SKYBOXThe skybox layer.
LAYERID_UIThe UI layer.
LAYERID_WORLDThe world layer.
LIGHTFALLOFF_INVERSESQUAREDInverse squared distance falloff model for light attenuation.
LIGHTFALLOFF_LINEARLinear distance falloff model for light attenuation.
LIGHTTYPE_DIRECTIONALDirectional (global) light source.
LIGHTTYPE_POINTPoint (local) light source.
LIGHTTYPE_SPOTSpot (local) light source.
MOUSEBUTTON_LEFTThe left mouse button
MOUSEBUTTON_MIDDLEThe middle mouse button
MOUSEBUTTON_NONENo mouse buttons pressed
MOUSEBUTTON_RIGHTThe right mouse button
ORIENTATION_HORIZONTALHorizontal orientation.
ORIENTATION_VERTICALVertical orientation.
PAD_1Index for pad 1
PAD_2Index for pad 2
PAD_3Index for pad 3
PAD_4Index for pad 4
PAD_DOWNDirection pad down
PAD_FACE_1The first face button, from bottom going clockwise
PAD_FACE_2The second face button, from bottom going clockwise
PAD_FACE_3The third face button, from bottom going clockwise
PAD_FACE_4The fourth face button, from bottom going clockwise
PAD_LEFTDirection pad left
PAD_L_SHOULDER_1The first shoulder button on the left
PAD_L_SHOULDER_2The second shoulder button on the left
PAD_L_STICK_BUTTONThe button when depressing the left analogue stick
PAD_L_STICK_XHorizontal axis on the left analogue stick
PAD_L_STICK_YVertical axis on the left analogue stick
PAD_RIGHTDirection pad right
PAD_R_SHOULDER_1The first shoulder button on the right
PAD_R_SHOULDER_2The second shoulder button on the right
PAD_R_STICK_BUTTONThe button when depressing the right analogue stick
PAD_R_STICK_XHorizontal axis on the right analogue stick
PAD_R_STICK_YVertical axis on the right analogue stick
PAD_SELECTThe select button
PAD_STARTThe start button
PAD_UPDirection pad up
PAD_VENDORVendor specific button
PARTICLEORIENTATION_EMITTERSimilar to previous, but the normal is affected by emitter(entity) transformation.
PARTICLEORIENTATION_SCREENParticles are facing camera.
PARTICLEORIENTATION_WORLDUser defines world space normal (particleNormal) to set planes orientation.
PARTICLESORT_DISTANCESorting based on distance to the camera.
PARTICLESORT_NEWER_FIRSTNewer particles are drawn first.
PARTICLESORT_NONENo sorting, particles are drawn in arbitary order.
PARTICLESORT_OLDER_FIRSTOlder particles are drawn first.
PIXELFORMAT_111110FA floating-point color-only format with 11 bits for red and green channels, and 10 bits for the blue channel (WebGL2 only).
PIXELFORMAT_A88-bit alpha.
PIXELFORMAT_ASTC_4x4ATC compressed format with alpha channel in blocks of 4x4.
PIXELFORMAT_ATC_RGBATC compressed format with no alpha channel.
PIXELFORMAT_ATC_RGBAATC compressed format with alpha channel.
PIXELFORMAT_DEPTHA readable depth buffer format
PIXELFORMAT_DEPTHSTENCILA readable depth/stencil buffer format (WebGL2 only).
PIXELFORMAT_DXT1Block compressed format, storing 16 input pixels in 64 bits of output, consisting of two 16-bit RGB 5:6:5 color values and a 4x4 two bit lookup table.
PIXELFORMAT_DXT3Block compressed format, storing 16 input pixels (corresponding to a 4x4 pixel block) into 128 bits of output, consisting of 64 bits of alpha channel data (4 bits for each pixel) followed by 64 bits of color data, encoded the same way as DXT1.
PIXELFORMAT_DXT5Block compressed format, storing 16 input pixels into 128 bits of output, consisting of 64 bits of alpha channel data (two 8 bit alpha values and a 4x4 3 bit lookup table) followed by 64 bits of color data (encoded the same way as DXT1).
PIXELFORMAT_ETC1ETC1 compressed format.
PIXELFORMAT_ETC2_RGBETC2 (RGB) compressed format.
PIXELFORMAT_ETC2_RGBAETC2 (RGBA) compressed format.
PIXELFORMAT_L88-bit luminance.
PIXELFORMAT_L8_A88-bit luminance with 8-bit alpha.
PIXELFORMAT_PVRTC_2BPP_RGBA_1PVRTC (2BPP RGBA) compressed format.
PIXELFORMAT_PVRTC_2BPP_RGB_1PVRTC (2BPP RGB) compressed format.
PIXELFORMAT_PVRTC_4BPP_RGBA_1PVRTC (4BPP RGBA) compressed format.
PIXELFORMAT_PVRTC_4BPP_RGB_1PVRTC (4BPP RGB) compressed format.
PIXELFORMAT_R32F32-bit floating point single channel format (WebGL2 only).
PIXELFORMAT_R4_G4_B4_A416-bit RGBA (4-bits for red channel, 4 for green, 4 for blue with 4-bit alpha).
PIXELFORMAT_R5_G5_B5_A116-bit RGBA (5-bits for red channel, 5 for green, 5 for blue with 1-bit alpha).
PIXELFORMAT_R5_G6_B516-bit RGB (5-bits for red channel, 6 for green and 5 for blue).
PIXELFORMAT_R8_G8_B824-bit RGB (8-bits for red channel, 8 for green and 8 for blue).
PIXELFORMAT_R8_G8_B8_A832-bit RGBA (8-bits for red channel, 8 for green, 8 for blue with 8-bit alpha).
PIXELFORMAT_RGB16F16-bit floating point RGB (16-bit float for each red, green and blue channels).
PIXELFORMAT_RGB32F32-bit floating point RGB (32-bit float for each red, green and blue channels).
PIXELFORMAT_RGBA16F16-bit floating point RGBA (16-bit float for each red, green, blue and alpha channels).
PIXELFORMAT_RGBA32F32-bit floating point RGBA (32-bit float for each red, green, blue and alpha channels).
PIXELFORMAT_SRGBColor-only sRGB format (WebGL2 only).
PIXELFORMAT_SRGBAColor sRGB format with additional alpha channel (WebGL2 only).
PRIMITIVE_LINELOOPList of points that are linked sequentially by line segments, with a closing line segment between the last and first points.
PRIMITIVE_LINESDiscrete list of line segments.
PRIMITIVE_LINESTRIPList of points that are linked sequentially by line segments.
PRIMITIVE_POINTSList of distinct points.
PRIMITIVE_TRIANGLESDiscrete list of triangles.
PRIMITIVE_TRIFANConnected fan of triangles where the first vertex forms triangles with the following pairs of vertices.
PRIMITIVE_TRISTRIPConnected strip of triangles where a specified vertex forms a triangle using the previous two.
PROJECTION_ORTHOGRAPHICAn orthographic camera projection where the frustum shape is essentially a cuboid.
PROJECTION_PERSPECTIVEA perspective camera projection where the frustum shape is essentially pyramidal.
RENDERSTYLE_POINTSRender mesh instance as points.
RENDERSTYLE_SOLIDRender mesh instance as solid geometry.
RENDERSTYLE_WIREFRAMERender mesh instance as wireframe.
RESOLUTION_AUTOWhen the canvas is resized the resolution of the canvas will change to match the size of the canvas.
RESOLUTION_FIXEDWhen the canvas is resized the resolution of the canvas will remain at the same value and the output will just be scaled to fit the canvas.
SCALEMODE_BLENDScale the pc.ScreenComponent when the application's resolution is different than the ScreenComponent's referenceResolution.
SCALEMODE_NONEAlways use the application's resolution as the resolution for the pc.ScreenComponent.
SCROLLBAR_VISIBILITY_SHOW_ALWAYSThe scrollbar will be visible all the time.
SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIREDThe scrollbar will be visible only when content exceeds the size of the viewport.
SCROLL_MODE_BOUNCEContent scrolls past its bounds and then gently bounces back.
SCROLL_MODE_CLAMPContent does not scroll any further than its bounds.
SCROLL_MODE_INFINITEContent can scroll forever.
SEMANTIC_ATTR0Vertex attribute with a user defined semantic.
SEMANTIC_ATTR1Vertex attribute with a user defined semantic.
SEMANTIC_ATTR10Vertex attribute with a user defined semantic.
SEMANTIC_ATTR11Vertex attribute with a user defined semantic.
SEMANTIC_ATTR12Vertex attribute with a user defined semantic.
SEMANTIC_ATTR13Vertex attribute with a user defined semantic.
SEMANTIC_ATTR14Vertex attribute with a user defined semantic.
SEMANTIC_ATTR15Vertex attribute with a user defined semantic.
SEMANTIC_ATTR2Vertex attribute with a user defined semantic.
SEMANTIC_ATTR3Vertex attribute with a user defined semantic.
SEMANTIC_ATTR4Vertex attribute with a user defined semantic.
SEMANTIC_ATTR5Vertex attribute with a user defined semantic.
SEMANTIC_ATTR6Vertex attribute with a user defined semantic.
SEMANTIC_ATTR7Vertex attribute with a user defined semantic.
SEMANTIC_ATTR8Vertex attribute with a user defined semantic.
SEMANTIC_ATTR9Vertex attribute with a user defined semantic.
SEMANTIC_BLENDINDICESVertex attribute to be treated as skin blend indices.
SEMANTIC_BLENDWEIGHTVertex attribute to be treated as skin blend weights.
SEMANTIC_COLORVertex attribute to be treated as a color.
SEMANTIC_NORMALVertex attribute to be treated as a normal.
SEMANTIC_POSITIONVertex attribute to be treated as a position.
SEMANTIC_TANGENTVertex attribute to be treated as a tangent.
SEMANTIC_TEXCOORD0Vertex attribute to be treated as a texture coordinate (set 0).
SEMANTIC_TEXCOORD1Vertex attribute to be treated as a texture coordinate (set 1).
SEMANTIC_TEXCOORD2Vertex attribute to be treated as a texture coordinate (set 2).
SEMANTIC_TEXCOORD3Vertex attribute to be treated as a texture coordinate (set 3).
SEMANTIC_TEXCOORD4Vertex attribute to be treated as a texture coordinate (set 4).
SEMANTIC_TEXCOORD5Vertex attribute to be treated as a texture coordinate (set 5).
SEMANTIC_TEXCOORD6Vertex attribute to be treated as a texture coordinate (set 6).
SEMANTIC_TEXCOORD7Vertex attribute to be treated as a texture coordinate (set 7).
SHADER_DEPTHRender RGBA-encoded depth value.
SHADER_FORWARDRender shaded materials with gamma correction and tonemapping.
SHADER_FORWARDHDRRender shaded materials without gamma correction and tonemapping.
SHADOW_PCF3Render depth (color-packed on WebGL 1.
SHADOW_PCF5Render depth buffer only, can be used for hardware-accelerated PCF 5x5 sampling.
SHADOW_VSM16Render 16-bit exponential variance shadow map.
SHADOW_VSM32Render 32-bit exponential variance shadow map.
SHADOW_VSM8Render packed variance shadow map.
SORTMODE_BACK2FRONTMesh instances are sorted back to front.
SORTMODE_FRONT2BACKMesh instances are sorted front to back.
SORTMODE_MANUALMesh instances are sorted based on pc.MeshInstance#drawOrder.
SORTMODE_MATERIALMESHMesh instances are sorted to minimize switching between materials and meshes to improve rendering performance.
SORTMODE_NONENo sorting is applied.
SPECOCC_AOUse AO directly to occlude specular.
SPECOCC_GLOSSDEPENDENTModify AO based on material glossiness/view angle to occlude specular.
SPECOCC_NONENo specular occlusion.
SPECULAR_BLINNEnergy-conserving Blinn-Phong.
SPECULAR_PHONGPhong without energy conservation.
SPRITETYPE_ANIMATEDA pc.SpriteComponent that renders sprite animations.
SPRITETYPE_SIMPLEA pc.SpriteComponent that displays a single frame from a sprite asset.
SPRITE_RENDERMODE_SIMPLEThis mode renders a sprite as a simple quad.
SPRITE_RENDERMODE_SLICEDThis mode renders a sprite using 9-slicing in 'sliced' mode.
SPRITE_RENDERMODE_TILEDThis mode renders a sprite using 9-slicing in 'tiled' mode.
STENCILOP_DECREMENTDecrement the value.
STENCILOP_DECREMENTWRAPDecrement the value, but wrap it to a maximum representable value, if the current value is 0.
STENCILOP_INCREMENTIncrement the value.
STENCILOP_INCREMENTWRAPIncrement the value, but wrap it to zero when it's larger than a maximum representable value.
STENCILOP_INVERTInvert the value bitwise.
STENCILOP_KEEPDon't change the stencil buffer value.
STENCILOP_REPLACEReplace value with the reference value (see pc.GraphicsDevice#setStencilFunc).
STENCILOP_ZEROSet value to zero.
TEXTURELOCK_READRead only.
TEXTURELOCK_WRITEWrite only.
TONEMAP_ACESACES filmic tonemapping curve.
TONEMAP_ACES2ACES v2 filmic tonemapping curve.
TONEMAP_FILMICFilmic tonemapping curve.
TONEMAP_HEJLHejl filmic tonemapping curve.
TONEMAP_LINEARLinear tonemapping.
TYPE_FLOAT32Floating point vertex element type.
TYPE_INT16Signed short vertex element type.
TYPE_INT32Signed integer vertex element type.
TYPE_INT8Signed byte vertex element type.
TYPE_UINT16Unsigned short vertex element type.
TYPE_UINT32Unsigned integer vertex element type.
TYPE_UINT8Unsigned byte vertex element type.
VIEW_CENTERCenter of view.
VIEW_LEFTLeft of view.
VIEW_RIGHTRight of view.
httpDefault instance of pc.Http.[read only]
shaderChunksObject containing all default shader chunks used by shader generators.[read only]

Static Methods

calculateNormalsGenerates normal information from the specified positions and triangle indices.
calculateTangentsGenerates tangent information from the specified positions, normals, texture coordinates and triangle indices.
createBoxCreates a procedural box-shaped mesh.
createCapsuleCreates a procedural capsule-shaped mesh.
createConeCreates a procedural cone-shaped mesh.
createCylinderCreates a procedural cylinder-shaped mesh.
createMeshCreates a new mesh object from the supplied vertex information and topology.
createPlaneCreates a procedural plane-shaped mesh.
createScriptMethod to create named pc.ScriptType.
createSphereCreates a procedural sphere-shaped mesh.
createStyleCreates a <style> DOM element from a string that contains CSS
createTorusCreates a procedural torus-shaped mesh.
drawFullscreenQuadDraw a screen-space rectangle in a render target.
getTouchTargetCoordsSimiliar to pc.getTargetCoords for the MouseEvents.
prefilterCubemapPrefilter a cubemap for use by a pc.StandardMaterial as an environment map.

Details

Static Properties

ADDRESS_CLAMP_TO_EDGEClamps texture coordinate to the range 0 to 1.
ADDRESS_MIRRORED_REPEATTexture coordinate to be set to the fractional part if the integer part is even; if the integer part is odd, then the texture coordinate is set to 1 minus the fractional part.
ADDRESS_REPEATIgnores the integer part of texture coordinates, using only the fractional part.
ASPECT_AUTOAutomatically set aspect ratio to current render target's width divided by height.
ASPECT_MANUALUse the manual aspect ratio value.
ASSET_ANIMATIONAsset type name for animation.
ASSET_AUDIOAsset type name for audio.
ASSET_CSSAsset type name for CSS.
ASSET_CUBEMAPAsset type name for cubemap.
ASSET_HTMLAsset type name for HTML.
ASSET_IMAGEAsset type name for image.
ASSET_JSONAsset type name for json.
ASSET_MATERIALAsset type name for material.
ASSET_MODELAsset type name for model.
ASSET_SCRIPTAsset type name for script.
ASSET_SHADERAsset type name for shader.
ASSET_TEXTAsset type name for text.
ASSET_TEXTUREAsset type name for texture.
BAKE_COLORSingle color lightmap.
BAKE_COLORDIRSingle color lightmap + dominant light direction (used for bump/specular).
BLENDEQUATION_ADDAdd the results of the source and destination fragment multiplies.
BLENDEQUATION_MAXUse the largest value. Check app.graphicsDevice.extBlendMinmax for support.
BLENDEQUATION_MINUse the smallest value. Check app.graphicsDevice.extBlendMinmax for support.
BLENDEQUATION_REVERSE_SUBTRACTReverse and subtract the results of the source and destination fragment multiplies.
BLENDEQUATION_SUBTRACTSubtract the results of the source and destination fragment multiplies.
BLENDMODE_DST_ALPHAMultiply all fragment components by the alpha value of the destination fragment.
BLENDMODE_DST_COLORMultiply all fragment components by the components of the destination fragment.
BLENDMODE_ONEMultiply all fragment components by one.
BLENDMODE_ONE_MINUS_DST_ALPHAMultiply all fragment components by one minus the alpha value of the destination fragment.
BLENDMODE_ONE_MINUS_DST_COLORMultiply all fragment components by one minus the components of the destination fragment.
BLENDMODE_ONE_MINUS_SRC_ALPHAMultiply all fragment components by one minus the alpha value of the source fragment.
BLENDMODE_ONE_MINUS_SRC_COLORMultiply all fragment components by one minus the components of the source fragment.
BLENDMODE_SRC_ALPHAMultiply all fragment components by the alpha value of the source fragment.
BLENDMODE_SRC_ALPHA_SATURATEMultiply all fragment components by the alpha value of the source fragment.
BLENDMODE_SRC_COLORMultiply all fragment components by the components of the source fragment.
BLENDMODE_ZEROMultiply all fragment components by zero.
BLEND_ADDITIVEAdd the color of the source fragment to the destination fragment and write the result to the frame buffer.
BLEND_ADDITIVEALPHASame as pc.BLEND_ADDITIVE except the source RGB is multiplied by the source alpha.
BLEND_MAXMaximum color. Check app.graphicsDevice.extBlendMinmax for support.
BLEND_MINMinimum color. Check app.graphicsDevice.extBlendMinmax for support.
BLEND_MULTIPLICATIVEMultiply the color of the source fragment by the color of the destination fragment and write the result to the frame buffer.
BLEND_MULTIPLICATIVE2XMultiplies colors and doubles the result
BLEND_NONEDisable blending.
BLEND_NORMALEnable simple translucency for materials such as glass. This is equivalent to enabling a source blend mode of pc.BLENDMODE_SRC_ALPHA and a destination blend mode of pc.BLENDMODE_ONE_MINUS_SRC_ALPHA.
BLEND_PREMULTIPLIEDSimilar to pc.BLEND_NORMAL expect the source fragment is assumed to have already been multiplied by the source alpha value.
BLEND_SCREENSofter version of additive
BLEND_SUBTRACTIVESubtract the color of the source fragment from the destination fragment and write the result to the frame buffer.
BLUR_BOXBox filter.
BLUR_GAUSSIANGaussian filter. May look smoother than box, but requires more samples.
BODYTYPE_DYNAMICRigid body is simulated according to applied forces.
BODYTYPE_KINEMATICRigid body has infinite mass and does not respond to forces but can still be moved by setting their velocity or position.
BODYTYPE_STATICRigid body has infinite mass and cannot move.
BUFFER_DYNAMICThe data store contents will be modified repeatedly and used many times.
BUFFER_GPUDYNAMICThe data store contents will be modified repeatedly on the GPU and used many times. Optimal for transform feedback usage (WebGL2 only).
BUFFER_STATICThe data store contents will be modified once and used many times.
BUFFER_STREAMThe data store contents will be modified once and used at most a few times.
BUTTON_TRANSITION_MODE_SPRITE_CHANGESpecifies different sprites for the hover, pressed and inactive states.
BUTTON_TRANSITION_MODE_TINTSpecifies different color tints for the hover, pressed and inactive states.
CLEARFLAG_COLORClear the color buffer.
CLEARFLAG_DEPTHClear the depth buffer.
CLEARFLAG_STENCILClear the stencil buffer.
CUBEFACE_NEGXThe negative X face of a cubemap.
CUBEFACE_NEGYThe negative Y face of a cubemap.
CUBEFACE_NEGZThe negative Z face of a cubemap.
CUBEFACE_POSXThe positive X face of a cubemap.
CUBEFACE_POSYThe positive Y face of a cubemap.
CUBEFACE_POSZThe positive Z face of a cubemap.
CUBEPROJ_BOXThe cube map is box-projected based on a world space axis-aligned bounding box.
CUBEPROJ_NONEThe cube map is treated as if it is infinitely far away.
CULLFACE_BACKTriangles facing away from the view direction are culled.
CULLFACE_FRONTTriangles facing the view direction are culled.
CULLFACE_FRONTANDBACKTriangles are culled regardless of their orientation with respect to the view direction. Note that point or line primitives are unaffected by this render state.
CULLFACE_NONENo triangles are culled.
CURVE_CARDINALA cardinal spline interpolation scheme. This interpolation scheme is deprecated. Use CURVE_SPLINE instead.
CURVE_CATMULLA Catmull-Rom spline interpolation scheme. This interpolation scheme is deprecated. Use CURVE_SPLINE instead.
CURVE_LINEARA linear interpolation scheme.
CURVE_SMOOTHSTEPA smooth step interpolation scheme.
CURVE_SPLINECardinal spline interpolation scheme. For Catmull-Rom, specify curve tension 0.5.
CURVE_STEPA stepped interpolater, free from the shackles of blending.
DISTANCE_EXPONENTIALExponential distance model
DISTANCE_INVERSEInverse distance model
DISTANCE_LINEARLinear distance model
ELEMENTTYPE_GROUPA pc.ElementComponent that contains child pc.ElementComponents.
ELEMENTTYPE_IMAGEA pc.ElementComponent that displays an image.
ELEMENTTYPE_TEXTA pc.ElementComponent that displays text.
EMITTERSHAPE_BOXBox shape parameterized by emitterExtents. Initial velocity is directed towards local Z axis.
EMITTERSHAPE_SPHERESphere shape parameterized by emitterRadius. Initial velocity is directed outwards from the center.
EVENT_KEYDOWNName of event fired when a key is pressed
EVENT_KEYUPName of event fired when a key is released
EVENT_MOUSEDOWNName of event fired when a mouse button is pressed
EVENT_MOUSEMOVEName of event fired when the mouse is moved
EVENT_MOUSEUPName of event fired when a mouse button is released
EVENT_MOUSEWHEELName of event fired when the mouse wheel is rotated
EVENT_TOUCHCANCELName of event fired when a touch point is interrupted in some way. The exact reasons for cancelling a touch can vary from device to device. For example, a modal alert pops up during the interaction; the touch point leaves the document area; or there are more touch points than the device supports, in which case the earliest touch point is canceled.
EVENT_TOUCHENDName of event fired when touch ends. For example, a finger is lifted off the device.
EVENT_TOUCHMOVEName of event fired when a touch moves.
EVENT_TOUCHSTARTName of event fired when a new touch occurs. For example, a finger is placed on the device.
FILLMODE_FILL_WINDOWWhen resizing the window the size of the canvas will change to fill the window exactly.
FILLMODE_KEEP_ASPECTWhen resizing the window the size of the canvas will change to fill the window as best it can, while maintaining the same aspect ratio.
FILLMODE_NONEWhen resizing the window the size of the canvas will not change.
FILTER_LINEARBilinear filtering.
FILTER_LINEAR_MIPMAP_LINEARLinearly interpolate both the mipmap levels and between texels.
FILTER_LINEAR_MIPMAP_NEARESTUse the nearest neighbor after linearly interpolating between mipmap levels.
FILTER_NEARESTPoint sample filtering.
FILTER_NEAREST_MIPMAP_LINEARLinearly interpolate in the nearest mipmap level.
FILTER_NEAREST_MIPMAP_NEARESTUse the nearest neighbor in the nearest mipmap level.
FITTING_BOTHApply both STRETCH and SHRINK fitting logic where applicable.
FITTING_NONEDisable all fitting logic.
FITTING_SHRINKShrink child elements to fit the parent container
FITTING_STRETCHStretch child elements to fit the parent container
FOG_EXPFog rises according to an exponential curve controlled by a density value.
FOG_EXP2Fog rises according to an exponential curve controlled by a density value.
FOG_LINEARFog rises linearly from zero to 1 between a start and end depth.
FOG_NONENo fog is applied to the scene.
FRESNEL_NONENo Fresnel.
FRESNEL_SCHLICKSchlick's approximation of Fresnel.
FUNC_ALWAYSAlways pass.
FUNC_EQUALPass if (ref & mask) == (stencil & mask).
FUNC_GREATERPass if (ref & mask) > (stencil & mask).
FUNC_GREATEREQUALPass if (ref & mask) >= (stencil & mask).
FUNC_LESSPass if (ref & mask) < (stencil & mask).
FUNC_LESSEQUALPass if (ref & mask) <= (stencil & mask).
FUNC_NEVERNever pass.
FUNC_NOTEQUALPass if (ref & mask) != (stencil & mask).
GAMMA_NONENo gamma correction.
GAMMA_SRGBApply sRGB gamma correction.
GAMMA_SRGBFASTApply sRGB (fast) gamma correction.
GAMMA_SRGBHDRApply sRGB (HDR) gamma correction.
INDEXFORMAT_UINT1616-bit unsigned vertex indices.
INDEXFORMAT_UINT3232-bit unsigned vertex indices.
INDEXFORMAT_UINT88-bit unsigned vertex indices.
KEY_0
KEY_1
KEY_2
KEY_3
KEY_4
KEY_5
KEY_6
KEY_7
KEY_8
KEY_9
KEY_A
KEY_ADD
KEY_ALT
KEY_B
KEY_BACKSPACE
KEY_BACK_SLASH
KEY_C
KEY_CAPS_LOCK
KEY_CLOSE_BRACKET
KEY_COMMA
KEY_CONTEXT_MENU
KEY_CONTROL
KEY_D
KEY_DECIMAL
KEY_DELETE
KEY_DIVIDE
KEY_DOWN
KEY_E
KEY_END
KEY_ENTER
KEY_EQUAL
KEY_ESCAPE
KEY_F
KEY_F1
KEY_F10
KEY_F11
KEY_F12
KEY_F2
KEY_F3
KEY_F4
KEY_F5
KEY_F6
KEY_F7
KEY_F8
KEY_F9
KEY_G
KEY_H
KEY_HOME
KEY_I
KEY_INSERT
KEY_J
KEY_K
KEY_L
KEY_LEFT
KEY_M
KEY_META
KEY_MULTIPLY
KEY_N
KEY_NUMPAD_0
KEY_NUMPAD_1
KEY_NUMPAD_2
KEY_NUMPAD_3
KEY_NUMPAD_4
KEY_NUMPAD_5
KEY_NUMPAD_6
KEY_NUMPAD_7
KEY_NUMPAD_8
KEY_NUMPAD_9
KEY_O
KEY_OPEN_BRACKET
KEY_P
KEY_PAGE_DOWN
KEY_PAGE_UP
KEY_PAUSE
KEY_PERIOD
KEY_PRINT_SCREEN
KEY_Q
KEY_R
KEY_RETURN
KEY_RIGHT
KEY_S
KEY_SEMICOLON
KEY_SEPARATOR
KEY_SHIFT
KEY_SLASH
KEY_SPACE
KEY_SUBTRACT
KEY_T
KEY_TAB
KEY_U
KEY_UP
KEY_V
KEY_W
KEY_WINDOWS
KEY_X
KEY_Y
KEY_Z
LAYERID_DEPTHThe depth layer.
LAYERID_IMMEDIATEThe immediate layer.
LAYERID_SKYBOXThe skybox layer.
LAYERID_UIThe UI layer.
LAYERID_WORLDThe world layer.
LIGHTFALLOFF_INVERSESQUAREDInverse squared distance falloff model for light attenuation.
LIGHTFALLOFF_LINEARLinear distance falloff model for light attenuation.
LIGHTTYPE_DIRECTIONALDirectional (global) light source.
LIGHTTYPE_POINTPoint (local) light source.
LIGHTTYPE_SPOTSpot (local) light source.
MOUSEBUTTON_LEFTThe left mouse button
MOUSEBUTTON_MIDDLEThe middle mouse button
MOUSEBUTTON_NONENo mouse buttons pressed
MOUSEBUTTON_RIGHTThe right mouse button
ORIENTATION_HORIZONTALHorizontal orientation.
ORIENTATION_VERTICALVertical orientation.
PAD_1Index for pad 1
PAD_2Index for pad 2
PAD_3Index for pad 3
PAD_4Index for pad 4
PAD_DOWNDirection pad down
PAD_FACE_1The first face button, from bottom going clockwise
PAD_FACE_2The second face button, from bottom going clockwise
PAD_FACE_3The third face button, from bottom going clockwise
PAD_FACE_4The fourth face button, from bottom going clockwise
PAD_LEFTDirection pad left
PAD_L_SHOULDER_1The first shoulder button on the left
PAD_L_SHOULDER_2The second shoulder button on the left
PAD_L_STICK_BUTTONThe button when depressing the left analogue stick
PAD_L_STICK_XHorizontal axis on the left analogue stick
PAD_L_STICK_YVertical axis on the left analogue stick
PAD_RIGHTDirection pad right
PAD_R_SHOULDER_1The first shoulder button on the right
PAD_R_SHOULDER_2The second shoulder button on the right
PAD_R_STICK_BUTTONThe button when depressing the right analogue stick
PAD_R_STICK_XHorizontal axis on the right analogue stick
PAD_R_STICK_YVertical axis on the right analogue stick
PAD_SELECTThe select button
PAD_STARTThe start button
PAD_UPDirection pad up
PAD_VENDORVendor specific button
PARTICLEORIENTATION_EMITTERSimilar to previous, but the normal is affected by emitter(entity) transformation.
PARTICLEORIENTATION_SCREENParticles are facing camera.
PARTICLEORIENTATION_WORLDUser defines world space normal (particleNormal) to set planes orientation.
PARTICLESORT_DISTANCESorting based on distance to the camera. CPU only.
PARTICLESORT_NEWER_FIRSTNewer particles are drawn first. CPU only.
PARTICLESORT_NONENo sorting, particles are drawn in arbitary order. Can be simulated on GPU.
PARTICLESORT_OLDER_FIRSTOlder particles are drawn first. CPU only.
PIXELFORMAT_111110FA floating-point color-only format with 11 bits for red and green channels, and 10 bits for the blue channel (WebGL2 only).
PIXELFORMAT_A88-bit alpha.
PIXELFORMAT_ASTC_4x4ATC compressed format with alpha channel in blocks of 4x4.
PIXELFORMAT_ATC_RGBATC compressed format with no alpha channel.
PIXELFORMAT_ATC_RGBAATC compressed format with alpha channel.
PIXELFORMAT_DEPTHA readable depth buffer format
PIXELFORMAT_DEPTHSTENCILA readable depth/stencil buffer format (WebGL2 only).
PIXELFORMAT_DXT1Block compressed format, storing 16 input pixels in 64 bits of output, consisting of two 16-bit RGB 5:6:5 color values and a 4x4 two bit lookup table.
PIXELFORMAT_DXT3Block compressed format, storing 16 input pixels (corresponding to a 4x4 pixel block) into 128 bits of output, consisting of 64 bits of alpha channel data (4 bits for each pixel) followed by 64 bits of color data, encoded the same way as DXT1.
PIXELFORMAT_DXT5Block compressed format, storing 16 input pixels into 128 bits of output, consisting of 64 bits of alpha channel data (two 8 bit alpha values and a 4x4 3 bit lookup table) followed by 64 bits of color data (encoded the same way as DXT1).
PIXELFORMAT_ETC1ETC1 compressed format.
PIXELFORMAT_ETC2_RGBETC2 (RGB) compressed format.
PIXELFORMAT_ETC2_RGBAETC2 (RGBA) compressed format.
PIXELFORMAT_L88-bit luminance.
PIXELFORMAT_L8_A88-bit luminance with 8-bit alpha.
PIXELFORMAT_PVRTC_2BPP_RGBA_1PVRTC (2BPP RGBA) compressed format.
PIXELFORMAT_PVRTC_2BPP_RGB_1PVRTC (2BPP RGB) compressed format.
PIXELFORMAT_PVRTC_4BPP_RGBA_1PVRTC (4BPP RGBA) compressed format.
PIXELFORMAT_PVRTC_4BPP_RGB_1PVRTC (4BPP RGB) compressed format.
PIXELFORMAT_R32F32-bit floating point single channel format (WebGL2 only).
PIXELFORMAT_R4_G4_B4_A416-bit RGBA (4-bits for red channel, 4 for green, 4 for blue with 4-bit alpha).
PIXELFORMAT_R5_G5_B5_A116-bit RGBA (5-bits for red channel, 5 for green, 5 for blue with 1-bit alpha).
PIXELFORMAT_R5_G6_B516-bit RGB (5-bits for red channel, 6 for green and 5 for blue).
PIXELFORMAT_R8_G8_B824-bit RGB (8-bits for red channel, 8 for green and 8 for blue).
PIXELFORMAT_R8_G8_B8_A832-bit RGBA (8-bits for red channel, 8 for green, 8 for blue with 8-bit alpha).
PIXELFORMAT_RGB16F16-bit floating point RGB (16-bit float for each red, green and blue channels).
PIXELFORMAT_RGB32F32-bit floating point RGB (32-bit float for each red, green and blue channels).
PIXELFORMAT_RGBA16F16-bit floating point RGBA (16-bit float for each red, green, blue and alpha channels).
PIXELFORMAT_RGBA32F32-bit floating point RGBA (32-bit float for each red, green, blue and alpha channels).
PIXELFORMAT_SRGBColor-only sRGB format (WebGL2 only).
PIXELFORMAT_SRGBAColor sRGB format with additional alpha channel (WebGL2 only).
PRIMITIVE_LINELOOPList of points that are linked sequentially by line segments, with a closing line segment between the last and first points.
PRIMITIVE_LINESDiscrete list of line segments.
PRIMITIVE_LINESTRIPList of points that are linked sequentially by line segments.
PRIMITIVE_POINTSList of distinct points.
PRIMITIVE_TRIANGLESDiscrete list of triangles.
PRIMITIVE_TRIFANConnected fan of triangles where the first vertex forms triangles with the following pairs of vertices.
PRIMITIVE_TRISTRIPConnected strip of triangles where a specified vertex forms a triangle using the previous two.
PROJECTION_ORTHOGRAPHICAn orthographic camera projection where the frustum shape is essentially a cuboid.
PROJECTION_PERSPECTIVEA perspective camera projection where the frustum shape is essentially pyramidal.
RENDERSTYLE_POINTSRender mesh instance as points.
RENDERSTYLE_SOLIDRender mesh instance as solid geometry.
RENDERSTYLE_WIREFRAMERender mesh instance as wireframe.
RESOLUTION_AUTOWhen the canvas is resized the resolution of the canvas will change to match the size of the canvas.
RESOLUTION_FIXEDWhen the canvas is resized the resolution of the canvas will remain at the same value and the output will just be scaled to fit the canvas.
SCALEMODE_BLENDScale the pc.ScreenComponent when the application's resolution is different than the ScreenComponent's referenceResolution.
SCALEMODE_NONEAlways use the application's resolution as the resolution for the pc.ScreenComponent.
SCROLLBAR_VISIBILITY_SHOW_ALWAYSThe scrollbar will be visible all the time.
SCROLLBAR_VISIBILITY_SHOW_WHEN_REQUIREDThe scrollbar will be visible only when content exceeds the size of the viewport.
SCROLL_MODE_BOUNCEContent scrolls past its bounds and then gently bounces back.
SCROLL_MODE_CLAMPContent does not scroll any further than its bounds.
SCROLL_MODE_INFINITEContent can scroll forever.
SEMANTIC_ATTR0Vertex attribute with a user defined semantic.
SEMANTIC_ATTR1Vertex attribute with a user defined semantic.
SEMANTIC_ATTR10Vertex attribute with a user defined semantic.
SEMANTIC_ATTR11Vertex attribute with a user defined semantic.
SEMANTIC_ATTR12Vertex attribute with a user defined semantic.
SEMANTIC_ATTR13Vertex attribute with a user defined semantic.
SEMANTIC_ATTR14Vertex attribute with a user defined semantic.
SEMANTIC_ATTR15Vertex attribute with a user defined semantic.
SEMANTIC_ATTR2Vertex attribute with a user defined semantic.
SEMANTIC_ATTR3Vertex attribute with a user defined semantic.
SEMANTIC_ATTR4Vertex attribute with a user defined semantic.
SEMANTIC_ATTR5Vertex attribute with a user defined semantic.
SEMANTIC_ATTR6Vertex attribute with a user defined semantic.
SEMANTIC_ATTR7Vertex attribute with a user defined semantic.
SEMANTIC_ATTR8Vertex attribute with a user defined semantic.
SEMANTIC_ATTR9Vertex attribute with a user defined semantic.
SEMANTIC_BLENDINDICESVertex attribute to be treated as skin blend indices.
SEMANTIC_BLENDWEIGHTVertex attribute to be treated as skin blend weights.
SEMANTIC_COLORVertex attribute to be treated as a color.
SEMANTIC_NORMALVertex attribute to be treated as a normal.
SEMANTIC_POSITIONVertex attribute to be treated as a position.
SEMANTIC_TANGENTVertex attribute to be treated as a tangent.
SEMANTIC_TEXCOORD0Vertex attribute to be treated as a texture coordinate (set 0).
SEMANTIC_TEXCOORD1Vertex attribute to be treated as a texture coordinate (set 1).
SEMANTIC_TEXCOORD2Vertex attribute to be treated as a texture coordinate (set 2).
SEMANTIC_TEXCOORD3Vertex attribute to be treated as a texture coordinate (set 3).
SEMANTIC_TEXCOORD4Vertex attribute to be treated as a texture coordinate (set 4).
SEMANTIC_TEXCOORD5Vertex attribute to be treated as a texture coordinate (set 5).
SEMANTIC_TEXCOORD6Vertex attribute to be treated as a texture coordinate (set 6).
SEMANTIC_TEXCOORD7Vertex attribute to be treated as a texture coordinate (set 7).
SHADER_DEPTHRender RGBA-encoded depth value.
SHADER_FORWARDRender shaded materials with gamma correction and tonemapping.
SHADER_FORWARDHDRRender shaded materials without gamma correction and tonemapping.
SHADOW_PCF3Render depth (color-packed on WebGL 1.0), can be used for PCF 3x3 sampling.
SHADOW_PCF5Render depth buffer only, can be used for hardware-accelerated PCF 5x5 sampling. Requires WebGL2. Falls back to pc.SHADOW_PCF3 on WebGL 1.0.
SHADOW_VSM16Render 16-bit exponential variance shadow map. Requires OES_texture_half_float extension. Falls back to pc.SHADOW_VSM8, if not supported.
SHADOW_VSM32Render 32-bit exponential variance shadow map. Requires OES_texture_float extension. Falls back to pc.SHADOW_VSM16, if not supported.
SHADOW_VSM8Render packed variance shadow map. All shadow receivers must also cast shadows for this mode to work correctly.
SORTMODE_BACK2FRONTMesh instances are sorted back to front. This is the way to properly render many semi-transparent objects on different depth, one is blended on top of another.
SORTMODE_FRONT2BACKMesh instances are sorted front to back. Depending on GPU and the scene, this option may give better performance than pc.SORTMODE_MATERIALMESH due to reduced overdraw.
SORTMODE_MANUALMesh instances are sorted based on pc.MeshInstance#drawOrder.
SORTMODE_MATERIALMESHMesh instances are sorted to minimize switching between materials and meshes to improve rendering performance.
SORTMODE_NONENo sorting is applied. Mesh instances are rendered in the same order they were added to a layer.
SPECOCC_AOUse AO directly to occlude specular.
SPECOCC_GLOSSDEPENDENTModify AO based on material glossiness/view angle to occlude specular.
SPECOCC_NONENo specular occlusion.
SPECULAR_BLINNEnergy-conserving Blinn-Phong.
SPECULAR_PHONGPhong without energy conservation. You should only use it as a backwards compatibility with older projects.
SPRITETYPE_ANIMATEDA pc.SpriteComponent that renders sprite animations.
SPRITETYPE_SIMPLEA pc.SpriteComponent that displays a single frame from a sprite asset.
SPRITE_RENDERMODE_SIMPLEThis mode renders a sprite as a simple quad.
SPRITE_RENDERMODE_SLICEDThis mode renders a sprite using 9-slicing in 'sliced' mode. Sliced mode stretches the top and bottom regions of the sprite horizontally, the left and right regions vertically and the middle region both horizontally and vertically.
SPRITE_RENDERMODE_TILEDThis mode renders a sprite using 9-slicing in 'tiled' mode. Tiled mode tiles the top and bottom regions of the sprite horizontally, the left and right regions vertically and the middle region both horizontally and vertically.
STENCILOP_DECREMENTDecrement the value.
STENCILOP_DECREMENTWRAPDecrement the value, but wrap it to a maximum representable value, if the current value is 0.
STENCILOP_INCREMENTIncrement the value.
STENCILOP_INCREMENTWRAPIncrement the value, but wrap it to zero when it's larger than a maximum representable value.
STENCILOP_INVERTInvert the value bitwise.
STENCILOP_KEEPDon't change the stencil buffer value.
STENCILOP_REPLACEReplace value with the reference value (see pc.GraphicsDevice#setStencilFunc).
STENCILOP_ZEROSet value to zero.
TEXTURELOCK_READRead only. Any changes to the locked mip level's pixels will not update the texture.
TEXTURELOCK_WRITEWrite only. The contents of the specified mip level will be entirely replaced.
TONEMAP_ACESACES filmic tonemapping curve.
TONEMAP_ACES2ACES v2 filmic tonemapping curve.
TONEMAP_FILMICFilmic tonemapping curve.
TONEMAP_HEJLHejl filmic tonemapping curve.
TONEMAP_LINEARLinear tonemapping.
TYPE_FLOAT32Floating point vertex element type.
TYPE_INT16Signed short vertex element type.
TYPE_INT32Signed integer vertex element type.
TYPE_INT8Signed byte vertex element type.
TYPE_UINT16Unsigned short vertex element type.
TYPE_UINT32Unsigned integer vertex element type.
TYPE_UINT8Unsigned byte vertex element type.
VIEW_CENTERCenter of view.
VIEW_LEFTLeft of view. Only used in stereo rendering.
VIEW_RIGHTRight of view. Only used in stereo rendering.
httpDefault instance of pc.Http.[read only]
shaderChunksObject containing all default shader chunks used by shader generators.[read only]

Static Methods

calculateNormals(positions, indices)

Generates normal information from the specified positions and triangle indices. See pc.createMesh.

var normals = pc.calculateNormals(positions, indices);
var tangents = pc.calculateTangents(positions, normals, uvs, indices);
var mesh = pc.createMesh(positions, normals, tangents, uvs, indices);

Parameters

positionsNumber[]An array of 3-dimensional vertex positions.
indicesNumber[]An array of triangle indices.

Returns

Number[] An array of 3-dimensional vertex normals.

calculateTangents(positions, normals, uvs, indices)

Generates tangent information from the specified positions, normals, texture coordinates and triangle indices. See pc.createMesh.

var tangents = pc.calculateTangents(positions, normals, uvs, indices);
var mesh = pc.createMesh(positions, normals, tangents, uvs, indices);

Parameters

positionsNumber[]An array of 3-dimensional vertex positions.
normalsNumber[]An array of 3-dimensional vertex normals.
uvsNumber[]An array of 2-dimensional vertex texture coordinates.
indicesNumber[]An array of triangle indices.

Returns

Number[] An array of 3-dimensional vertex tangents.

createBox(device, [opts])

Creates a procedural box-shaped mesh. The size, shape and tesselation properties of the box can be controlled via function parameters. By default, the function will create a box centred on the object space origin with a width, length and height of 1.0 unit and 10 segments in either axis (50 triangles per face).
Note that the box is created with UVs in the range of 0 to 1 on each face. Additionally, tangent information is generated into the vertex buffer of the box's mesh.

Parameters

devicepc.GraphicsDeviceThe graphics device used to manage the mesh.
optsObjectAn object that specifies optional inputs for the function as follows:
opts.halfExtentspc.Vec3The half dimensions of the box in each axis (defaults to [0.5, 0.5, 0.5]).
opts.widthSegmentsNumberThe number of divisions along the X axis of the box (defaults to 1).
opts.lengthSegmentsNumberThe number of divisions along the Z axis of the box (defaults to 1).
opts.heightSegmentsNumberThe number of divisions along the Y axis of the box (defaults to 1).

Returns

pc.Mesh A new box-shaped mesh.

createCapsule(device, [opts])

Creates a procedural capsule-shaped mesh. The size, shape and tesselation properties of the capsule can be controlled via function parameters. By default, the function will create a capsule standing vertically centred on the XZ-plane with a radius of 0.25, a height of 1.0, 1 height segment and 10 cap segments.
Note that the capsule is created with UVs in the range of 0 to 1. Additionally, tangent information is generated into the vertex buffer of the capsule's mesh.

Parameters

devicepc.GraphicsDeviceThe graphics device used to manage the mesh.
optsObjectAn object that specifies optional inputs for the function as follows:
opts.radiusNumberThe radius of the tube forming the body of the capsule (defaults to 0.3).
opts.heightNumberThe length of the body of the capsule from tip to tip (defaults to 1.0).
opts.heightSegmentsNumberThe number of divisions along the tubular length of the capsule (defaults to 1).
opts.sidesNumberThe number of divisions around the tubular body of the capsule (defaults to 20).

Returns

pc.Mesh A new cylinder-shaped mesh.

createCone(device, [opts])

Creates a procedural cone-shaped mesh.

The size, shape and tesselation properties of the cone can be controlled via function parameters. By default, the function will create a cone standing vertically centred on the XZ-plane with a base radius of 0.5, a height of 1.0, 5 height segments and 20 cap segments.
Note that the cone is created with UVs in the range of 0 to 1. Additionally, tangent information is generated into the vertex buffer of the cone's mesh.

Parameters

devicepc.GraphicsDeviceThe graphics device used to manage the mesh.
optsObjectAn object that specifies optional inputs for the function as follows:
opts.baseRadiusNumberThe base radius of the cone (defaults to 0.5).
opts.peakRadiusNumberThe peak radius of the cone (defaults to 0.0).
opts.heightNumberThe length of the body of the cone (defaults to 1.0).
opts.heightSegmentsNumberThe number of divisions along the length of the cone (defaults to 5).
opts.capSegmentsNumberThe number of divisions around the tubular body of the cone (defaults to 18).

Returns

pc.Mesh A new cone-shaped mesh.

createCylinder(device, [opts])

Creates a procedural cylinder-shaped mesh. The size, shape and tesselation properties of the cylinder can be controlled via function parameters. By default, the function will create a cylinder standing vertically centred on the XZ-plane with a radius of 0.5, a height of 1.0, 1 height segment and 20 cap segments.
Note that the cylinder is created with UVs in the range of 0 to 1. Additionally, tangent information is generated into the vertex buffer of the cylinder's mesh.

Parameters

devicepc.GraphicsDeviceThe graphics device used to manage the mesh.
optsObjectAn object that specifies optional inputs for the function as follows:
opts.radiusNumberThe radius of the tube forming the body of the cylinder (defaults to 0.5).
opts.heightNumberThe length of the body of the cylinder (defaults to 1.0).
opts.heightSegmentsNumberThe number of divisions along the length of the cylinder (defaults to 5).
opts.capSegmentsNumberThe number of divisions around the tubular body of the cylinder (defaults to 20).

Returns

pc.Mesh A new cylinder-shaped mesh.

createMesh(device, positions, [opts])

Creates a new mesh object from the supplied vertex information and topology.

// Create a new mesh supplying optional parameters using object literal notation
var mesh = pc.createMesh(
    graphicsDevice,
    positions,
    {
        normals: treeNormals,
        uvs: treeUvs,
        indices: treeIndices
    });

Parameters

devicepc.GraphicsDeviceThe graphics device used to manage the mesh.
positionsNumber[]An array of 3-dimensional vertex positions.
optsObjectAn object that specifies optional inputs for the function as follows:
opts.normalsNumber[]An array of 3-dimensional vertex normals.
opts.tangentsNumber[]An array of 3-dimensional vertex tangents.
opts.colorsNumber[]An array of 4-dimensional vertex colors.
opts.uvsNumber[]An array of 2-dimensional vertex texture coordinates.
opts.uvs1Number[]Same as opts.uvs, but for additional UV set
opts.indicesNumber[]An array of triangle indices.

Returns

pc.Mesh A new Geometry constructed from the supplied vertex and triangle data.

createPlane(device, [opts])

Creates a procedural plane-shaped mesh. The size and tesselation properties of the plane can be controlled via function parameters. By default, the function will create a plane centred on the object space origin with a width and length of 1.0 and 5 segments in either axis (50 triangles). The normal vector of the plane is aligned along the positive Y axis.
Note that the plane is created with UVs in the range of 0 to 1. Additionally, tangent information is generated into the vertex buffer of the plane's mesh.

Parameters

devicepc.GraphicsDeviceThe graphics device used to manage the mesh.
optsObjectAn object that specifies optional inputs for the function as follows:
opts.halfExtentspc.Vec2The half dimensions of the plane in the X and Z axes (defaults to [0.5, 0.5]).
opts.widthSegmentsNumberThe number of divisions along the X axis of the plane (defaults to 5).
opts.lengthSegmentsNumberThe number of divisions along the Z axis of the plane (defaults to 5).

Returns

pc.Mesh A new plane-shaped mesh.

createScript(name, [app])

Method to create named pc.ScriptType. It returns new function (class) "Script Type", which is auto-registered to pc.ScriptRegistry using it's name. This is the main interface to create Script Types, to define custom logic using JavaScript, that is used to create interaction for entities.

var Turning = pc.createScript('turn');

// define `speed` attribute that is available in Editor UI
Turning.attributes.add('speed', {
    type: 'number',
    default: 180,
    placeholder: 'deg/s'
});

// runs every tick
Turning.prototype.update = function(dt) {
    this.entity.rotate(0, this.speed * dt, 0);
};

Parameters

nameStringunique Name of a Script Type. If a Script Type with the same name has already been registered and the new one has a `swap` method defined in its prototype, then it will perform hot swapping of existing Script Instances on entities using this new Script Type. Note: There is a reserved list of names that cannot be used, such as list below as well as some starting from `_` (underscore): system, entity, create, destroy, swap, move, scripts, onEnable, onDisable, onPostStateChange, has, on, off, fire, once, hasEvent
apppc.ApplicationOptional application handler, to choose which pc.ScriptRegistry to add a script to. By default it will use `pc.Application.getApplication()` to get current pc.Application.

Returns

pc.ScriptType The constructor of a pc.ScriptType, which the developer is meant to extend by adding attributes and prototype methods.

createSphere(device, [opts])

Creates a procedural sphere-shaped mesh. The size and tesselation properties of the sphere can be controlled via function parameters. By default, the function will create a sphere centred on the object space origin with a radius of 0.5 and 16 segments in both longitude and latitude.
Note that the sphere is created with UVs in the range of 0 to 1. Additionally, tangent information is generated into the vertex buffer of the sphere's mesh.

Parameters

devicepc.GraphicsDeviceThe graphics device used to manage the mesh.
optsObjectAn object that specifies optional inputs for the function as follows:
opts.radiusNumberThe radius of the sphere (defaults to 0.5).
opts.segmentsNumberThe number of divisions along the longitudinal and latitudinal axes of the sphere (defaults to 16).

Returns

pc.Mesh A new sphere-shaped mesh.

createStyle(cssString)

Creates a <style> DOM element from a string that contains CSS

var css = 'body {height: 100;}';
var style = pc.createStyle(css);
document.head.appendChild(style);

Parameters

cssStringStringA string that contains valid CSS

Returns

Element The style DOM element

createTorus(device, [opts])

Creates a procedural torus-shaped mesh. The size, shape and tesselation properties of the torus can be controlled via function parameters. By default, the function will create a torus in the XZ-plane with a tube radius of 0.2, a ring radius of 0.3, 20 segments and 30 sides.
Note that the torus is created with UVs in the range of 0 to 1. Additionally, tangent information is generated into the vertex buffer of the torus's mesh.

Parameters

devicepc.GraphicsDeviceThe graphics device used to manage the mesh.
optsObjectAn object that specifies optional inputs for the function as follows:
opts.tubeRadiusNumberThe radius of the tube forming the body of the torus (defaults to 0.2).
opts.ringRadiusNumberThe radius from the centre of the torus to the centre of the tube (defaults to 0.3).
opts.segmentsNumberThe number of radial divisions forming cross-sections of the torus ring (defaults to 20).
opts.sidesNumberThe number of divisions around the tubular body of the torus ring (defaults to 30).

Returns

pc.Mesh A new torus-shaped mesh.

drawFullscreenQuad(device, target, vertexBuffer, shader, [rect])

Draw a screen-space rectangle in a render target. Primarily meant to be used in custom post effects based on pc.PostEffect.

Parameters

devicepc.GraphicsDeviceThe graphics device of the application.
targetpc.RenderTargetThe output render target.
vertexBufferpc.VertexBufferThe vertex buffer for the rectangle mesh. When calling from a custom post effect, pass the field pc.PostEffect#vertexBuffer.
shaderpc.ShaderThe shader to be used for drawing the rectangle. When calling from a custom post effect, pass the field pc.PostEffect#shader.
rectpc.Vec4The normalized screen-space position (rect.x, rect.y) and size (rect.z, rect.w) of the rectangle. Default is (0, 0, 1, 1);

getTouchTargetCoords(touch)

Similiar to pc.getTargetCoords for the MouseEvents. This function takes a browser Touch object and returns the co-ordinates of the touch relative to the target element.

Parameters

touchTouchThe browser Touch object

Returns

Object The co-ordinates of the touch relative to the touch.target element. In the format {x, y}

prefilterCubemap(options)

Prefilter a cubemap for use by a pc.StandardMaterial as an environment map. Should only be used for cubemaps that can't be prefiltered ahead of time (in the editor).

Parameters

optionsObjectThe options for how the cubemap is prefiltered.