Interface: View
Encompasses all the state needed for rendering a Scene.
Renderer#render operates on View
objects. These View
objects
specify important parameters such as:
- The Scene
- The Camera
- The Viewport
- Some rendering parameters
View
instances are heavy objects that internally cache a lot of data needed for
rendering. It is not advised for an application to use many View objects.
For example, in a game, a View
could be used for the main scene and another one for
the game's user interface. More View
instances could be used for creating special
effects (e.g. a View
is akin to a rendering pass).
Extends
PointerHolder
Properties
antiAliasing
antiAliasing:
"none"
|"FXAA"
Enables or disables anti-aliasing in the post-processing stage. Enabled by default. MSAA can be enabled in addition, see setSampleCount().
Param
FXAA for enabling, NONE for disabling anti-aliasing.
Note
For MSAA anti-aliasing, see setSamplerCount().
Default
'FXAA'
Defined in
camera
camera:
RNFCamera
Defined in
dithering
dithering:
"none"
|"temporal"
Enables or disables dithering in the post-processing stage. Enabled by default.
Default
'temporal'
Defined in
isValid
readonly
isValid:boolean
Get if the refernce to the native pointer is still valid and strong.
If this is false
, this object has been manually released with
release
() and all other methods on this object will throw an Error.
Inherited from
PointerHolder.isValid
Defined in
postProcessing
postProcessing:
boolean
Enables or disables post processing. Enabled by default.
Post-processing includes:
- Depth-of-field
- Bloom
- Vignetting
- Temporal Anti-aliasing (TAA)
- Color grading & gamma encoding
- Dithering
- FXAA
- Dynamic scaling
Disabling post-processing forgoes color correctness as well as some anti-aliasing techniques and should only be used for debugging, UI overlays or when using custom render targets (see RenderTarget).
Default
true
See
setBloomOptions, setColorGrading, setAntiAliasing, setDithering, setSampleCount
Defined in
scene
scene:
Scene
Defined in
screenSpaceRefraction
screenSpaceRefraction:
boolean
Enables or disables screen space refraction.
Default
true
Defined in
shadowing
shadowing:
boolean
Enables or disables shadow mapping. Enabled by default.
See
LightManager::Builder::castShadows(), RenderableManager::Builder::receiveShadows(), RenderableManager::Builder::castShadows(),
Default
true
Defined in
temporalAntiAliasingOptions
temporalAntiAliasingOptions:
Record
<string
,number
>
This type is the raw expected valeu for JSI.
The type is encoded in TemporalAntiAliasingOptions
Defined in
Methods
createAmbientOcclusionOptions()
createAmbientOcclusionOptions():
AmbientOcclusionOptions
Returns
Defined in
createDynamicResolutionOptions()
createDynamicResolutionOptions():
DynamicResolutionOptions
Returns
Defined in
getAmbientOcclusionOptions()
getAmbientOcclusionOptions():
AmbientOcclusionOptions
Returns
Defined in
getAspectRatio()
getAspectRatio():
number
Returns
number
Defined in
getDynamicResolutionOptions()
getDynamicResolutionOptions():
DynamicResolutionOptions
Returns
Defined in
getViewport()
getViewport():
Viewport
Returns
Defined in
pickEntity()
pickEntity(
x
,y
):Promise
<null
|Entity
>
Given 2D screen coordinates, returns the entity at that position. Returns undefined if no entity is found.
Parameters
• x: number
• y: number
Returns
Promise
<null
| Entity
>
Defined in
projectWorldToScreen()
projectWorldToScreen(
worldPosition
): [number
,number
]
Given a world position, returns the 2D screen coordinates.
Parameters
• worldPosition: Float3
Returns
[number
, number
]
Defined in
release()
release():
void
Manually release this reference to the native pointer. This will ensure that JS will no longer hold a strong reference, and memory can be safely cleaned up.
If the native pointer is still referenced elsewhere in native code, the underlying memory will not be deleted unless the other references are also released.
If this is not called, the memory will only be cleaned once the JS gabage collector decides to delete this object, which might be at any point in the future.
Calling release()
is not required as the GC will destroy this
object eventually anyways, but it is recommended to optimize
memory usage.
After manually releasing a pointer, all future methods on this object will throw an Error.
Returns
void
Inherited from
PointerHolder.release
Defined in
setAmbientOcclusionOptions()
setAmbientOcclusionOptions(
options
):void
Parameters
• options: AmbientOcclusionOptions
Returns
void
Defined in
setDynamicResolutionOptions()
setDynamicResolutionOptions(
options
):void
Parameters
• options: DynamicResolutionOptions
Returns
void