PopcornFX v2.18

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
  1. Home
  2. Docs
  3. PopcornFX v2.18
  4. Node Reference
  5. Builtin nodes
  6. Renderers
  7. Triangle

Triangle

Overview

triangle renderer node
triangle renderer node

 

Triangle renderers displays the particles as triangles.
You can specify the position, color, normal, and UVs of each vertex of the triangle and have a full control over the shape and transformation of the triangle.
This renderer is not yet supported in all our public integrations.

Triangle renderer sample

Default Materials:

  • Default_Triangle: Regular transparent triangle (additive, alpha-blended, or premultiplied-alpha)
  • Opaque_Triangle: Opaque triangle, can use alpha-testing for cutouts

 

Triangle custom normals

If your triangles are lit, you might want to specify custom normals for each vertex of the triangle renderer. By default, the triangle renderer can generate its own normal and tangent.

Here is an effect that reconstructs a mesh using the triangle renderer, showing the result with and without providing per-vertex normals to the renderer.

Mesh reconstruction triangle renderer
The “Custom Normals” feature is not enabled here, you can see that the triangles are “flat”: There is a single triangle normal, auto-generated from the vertex positions.

Mesh reconstruction with custom normals
The “Custom Normals” feature is enabled, the triangle renderer takes the actual vertex normal of the mesh as input. This creates a “smooth” lighting on the mesh.

You can also use the “Normal Bending Factor” that will curve the normals and tangents depending on the barycenter of the triangle.

Triangle custom UVs

You can also specify a per-vertex UV coordinate on the triangle renderer using the “Triangle Custom U V s” feature. The tangent of the triangle will be automatically computed depending on the UVs and normals set as inputs.

The default value for the vertices UVs when the “Triangle Custom U V s” feature is disabled are (0, 0), (1, 0), (0, 1).

 

Material: Default_Triangle

PropertyTypeDescription
LitboolEnables the Lit rendering feature:
Lights the particle with the scene lights.
TriangleCustomNormalsboolEnables the Triangle Custom Normals rendering feature:
Allows to specify a distinct normal for each triangle vertex. When disabled, each vertex will use the normal of the triangle plane.
TriangleCustomUVsboolEnables the Triangle Custom UVs rendering feature:
Allows to specify a custom UV coordinate for each triangle vertex.
NormalBendboolEnables the Normal Bend rendering feature:
Bends the normals of the triangle to mimic a spherical surface when lighting is enabled.
TypeenumTransparent blending mode.

  • Additive
  • AdditiveNoAlpha
  • AlphaBlend
  • PremultipliedAlpha
SortModeenumAllows to specify a custom sorting key.

  • CameraDistance: Sorts from back to front based on the particle distance to the camera (default)
  • ByCustomValue: When selected, uses the per-particle SortKey input as the value to sort based on, from largest first to smallest last, like if it was a distance value.
GlobalSortOverrideintGlobal sort order of the draw calls.
Different values for 2 renderers will break batching and separate their drawcall.
Smaller values are drawn first (visually behind higher values). The value can be negative.
CameraSortOffsetfloatUsed as a depth bias to allow offseting the draw call bbox along the camera axis (in world units).
Different values for 2 renderers will break batching and separate their drawcall.
+ all common renderer properties
Input pins
Position1float3Position of the first triangle vertex in world coordinates
Position2float3Position of the second triangle vertex in world coordinates
Position3float3Position of the third triangle vertex in world coordinates
DiffuseMapStringTexture map used for the diffuse lighting component.
Colorfloat4Diffuse color, multiplied with the diffuse map color.
SortKeyfloatValue to be used for sorting when SortMode is set to ByCustomValue

 

Material: Opaque_Triangle

PropertyTypeDescription
LitboolEnables the Lit rendering feature:
Lights the particle with the scene lights.
TriangleCustomNormalsboolEnables the Triangle Custom Normals rendering feature:
Allows to specify a distinct normal for each triangle vertex. When disabled, each vertex will use the normal of the triangle plane.
TriangleCustomUVsboolEnables the Triangle Custom UVs rendering feature:
Allows to specify a custom UV coordinate for each triangle vertex.
NormalBendboolEnables the Normal Bend rendering feature:
Bends the normals of the triangle to mimic a spherical surface when lighting is enabled.
TypeenumOpaque mode

  • Solid: Fully opaque, ignores the texture & color alpha channel
  • Masked: When the final pixel’s alpha value is lower than MaskThreshold, the pixel is not drawn
MaskThresholdfloatOpacity mask threshold value.
If the alpha value is below this value, the pixel is discarded.
+ all common renderer properties
Input pins
Position1float3Position of the first triangle vertex in world coordinates
Position2float3Position of the second triangle vertex in world coordinates
Position3float3Position of the third triangle vertex in world coordinates
DiffuseMapStringTexture map used for the diffuse lighting component.
Colorfloat4Diffuse color, multiplied with the diffuse map color.

 

Render-features

Lit

Lights the particle with the scene lights.

PropertyTypeDescription
CastShadowsboolCan cast shadows
RoughnessfloatMaterial roughness (PBR). A roughness of 0.0 represents a mirror, a roughness of 1.0 represents a purely diffuse surface.
MetalnessfloatMaterial metalness (PBR). A metalness of 0.0 represents a pure nonmetal, a metalness of 1.0 represents a pure metal.
Affects the color of the reflections.
Typeenum
  • Solid
  • Transparent
Input pins
NormalMapStringTexture map representing tangent-space normals to be used for lighting.
RoughMetalMapStringRoughness (R) and Metalness (G) packed in an RGBA texture
LitMaskMapString

 

TriangleCustomNormals

Allows to specify a distinct normal for each triangle vertex. When disabled, each vertex will use the normal of the triangle plane.

PropertyTypeDescription
Normal1float3Normal of the first triangle vertex in world coordinates
Normal2float3Normal of the second triangle vertex in world coordinates
Normal3float3Normal of the third triangle vertex in world coordinates

 

TriangleCustomUVs

Allows to specify a custom UV coordinate for each triangle vertex.

PropertyTypeDescription
UV1float2UV coordinates of the first triangle vertex
UV2float2UV coordinates of the second triangle vertex
UV3float2UV coordinates of the third triangle vertex

 

 

Was this article helpful to you? Yes No

How can we help?