Close

Point Sprite MAT

Summary

The Point Sprite MAT allows you to control some attributes of Point Sprites (creatable using the Particle SOP, DAT to SOP, or Convert SOP). You can apply color, a color map, change the size of the created point sprite from a square to a rectangle, and scale the size of the point sprite.

A point sprite's final size controls the number of pixels wide/high it is, regardless of how far it is from the camera (unless you are using attenuation).

PythonIcon.pngpointspriteMAT_Class


Parameters - Point Sprite Page

Color color - - The color of the light reflected from the material.
  • Red colorr -
  • Green colorg -
  • Blue colorb -

Alpha alpha - The opacity of the material. This parameter is multiplied by point alpha of the object.

Post-Mult Color by Alpha postmultalpha - Enable/disable multiplying color by alpha.

Color Map colormap - - The color map to apply to the sprites. The Color Map will be multiplied by the color of the sprites. The Color Map parameter can also take 3D / 2D Texture Arrays (from the Texture 3D TOP for example), and the w texture coordinate will select the correct map from the array.

The final size of the point sprite is controlled by the pscale point attribute (if present) getting multiplied of the result of the next 6 parameters. There are two types of scale this MAT can apply, and they are blended using the Attenuate Point Scale parameter to create one final point scale (which is multiplied by pscale).

Extend U colormapextendu - -
  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -
Extend V colormapextendv - -
  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -
Extend W colormapextendw - -
  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -
Filter colormapfilter - -
  • Nearest nearest -
  • Linear linear -
  • Mipmap Linear mipmaplinear -
Anisotropic Filter colormapanisotropy - -
  • Off off -
  • 2x 2x -
  • 4x 4x -
  • 8x 8x -
  • 16x 16x -

Offset Left offsetleft - Crop the left side of the sprites.

Offset Right offsetright - Crop the right side of the sprites.

Offset Bottom offsetbottom - Crop the bottom side of the sprites.

Offset Top offsettop - Crop the top side of the sprites.

Constant Point Scale pointscale - A constant value that is applied to all points evenly. When Attenuate Point Scale is 0, the point sprite size will be pscale * this value.

Attenuate Point Scale attenpscale - This value blends between the Constant Point Scale and the Attenuated Point Scale. 0 means 100% constant point scale and 1 means 100% attenuated point scale.

Points that are closer than or at the Near distance from the camera will use the Near Point Scale, points between the Near Distance and Far Distance will use a blended scale between the Near Point Scale and the Far Point Scale. Points farther than the Far Point Distance will use the Far Point Scale.

Attenuate Near Distance attennear - Points that are closer than or at this distance from the camera will use the Near Point Scale Parameter.

Attenuate Far Distance attenfar - Points that are farther than or at this distance from the camera will use the Far Point Scale Parameter.

Near Point Scale attensizenear - This point scale is applied at the near distance.

Far Point Scale attensizefar - This point scale is applied at the far distance.


Parameters - Deform Page

Refer to the Deform Article for more information on doing deforms in TouchDesigner.

Deform dodeform - Enables deforms on this material.

Get Bone Data: deformdata - - Specifies where the deform bone data will be obtained.
  • From a SOP sop -
  • From another MAT mat -
  • From a DeformIn MAT deformin -
SOP with Capture Data targetsop - Specifies the SOP that contains the deform capture attributes.

pCaptPath Attrib pcaptpath - Specifies the name of the pCaptPath attribute to use. When your geometry has been put through a Bone Group SOP, the attributes will be split into names like pCaptPath0, pCaptPath1. You can only render 1 bone group at a time, so this should match the group you are rendering with this material.

pCaptData Attrib pcaptdata - Much like pCaptPath Attrib.

Skeleton Root Path skelrootpath - Specifies the path to the COMP where the root of the skeleton is located.

MAT mat - When obtaining deform data from a MAT or a Deform In MAT, this is where that MAT is specified.


Parameters - Common Page

Blending

Blending is summing the color value of the pixel being drawn and the pixel currently present in the Color-Buffer. Blending is typically used to simulate Transparency. The blending equation is: Final Pixel Value = (Source Blend * Source Color) + (Dest Blend * Destination Color)


Blending (Transparency) blending - This toggle enables and disables blending. However see the wiki article Transparency.

Blend Operation blendop - -
  • Add add -
  • Subtract subtract -
  • Reverse Subtract revsubtract -
  • Minimum minimum -
  • Maximum maximum -
Source Color * srcblend - - This value is multiplied by the color value of the pixel that is being written to the Color-Buffer (also know as the Source Color).
  • Zero zero -
  • Dest Color dcol -
  • One Minus Dest Color omdcol -
  • Source Alpha sa -
  • One Minus Source Alpha omsa -
  • Dest Alpha da -
  • One Minus Dest Alpha omda -
  • Source Alpha Saturate sas -
  • One one -
  • Constant Color constantcol -
  • One Minus Constant Color omconstantcol -
  • Constant Alpha constanta -
  • One Minus Constant Alpha omconstanta -
Destination Color * destblend - - This value is multiplied by the color value of the pixel currently in the Color-Buffer (also known as the Destination Color).
  • One one -
  • Src Color scol -
  • One Minus Src Color omscol -
  • Source Alpha sa -
  • One Minus Source Alpha omsa -
  • Dest Alpha da -
  • One Minus Dest Alpha omda -
  • Zero zero -
  • Dest Color dcol -
  • One Minus Dest Color omdcol -
  • Source Alpha Saturate sas -
  • Constant Color constantcol -
  • One Minus Constant Color omconstantcol -
  • Constant Alpha constanta -
  • One Minus Constant Alpha omconstanta -
Separate Alpha Function separatealphafunc - This toggle enables and disables separate blending options for the alpha values.

Alpha Blend Operation blendopa - -
  • Add add -
  • Subtract subtract -
  • Reverse Subtract revsubtract -
  • Minimum minimum -
  • Maximum maximum -
Source Alpha * srcblenda - - This value is multiplied by the alpha value of the pixel that is being written to the Color-Buffer (also know as the Source Alpha).
  • Zero zero -
  • Dest Color dcol -
  • One Minus Dest Color omdcol -
  • Source Alpha sa -
  • One Minus Source Alpha omsa -
  • Dest Alpha da -
  • One Minus Dest Alpha omda -
  • Source Alpha Saturate sas -
  • One one -
  • Constant Color constantcol -
  • One Minus Constant Color omconstantcol -
  • Constant Alpha constanta -
  • One Minus Constant Alpha omconstanta -
Destination Alpha * destblenda - - This value is multiplied by the alpha value of the pixel currently in the Color-Buffer (also known as the Destination Alpha).
  • One one -
  • Src Color scol -
  • One Minus Src Color omscol -
  • Source Alpha sa -
  • One Minus Source Alpha omsa -
  • Dest Alpha da -
  • One Minus Dest Alpha omda -
  • Zero zero -
  • Dest Color dcol -
  • One Minus Dest Color omdcol -
  • Source Alpha Saturate sas -
  • Constant Color constantcol -
  • One Minus Constant Color omconstantcol -
  • Constant Alpha constanta -
  • One Minus Constant Alpha omconstanta -
Blend Constant Color blendconstant - -
  • Blend Constant Color blendconstantr -
  • Blend Constant Color blendconstantg -
  • Blend Constant Color blendconstantb -
Blend Constant Alpha blendconstanta -

Legacy Alpha Behavior legacyalphabehavior -

Post-Mult Color by Alpha postmultalpha - Multiplies the color by alpha after all other operations have taken place.

Point Color Pre-Multiply pointcolorpremult - -
  • Already Pre-Multiplied By Alpha alreadypremult -
  • Pre-Multiply By Alpha in Shader premultinshader -
Depth Test depthtest - Enables and disables the Depth-Test. If the depth-test is disabled, depths values aren't written to the Depth-Buffer.

Depth Test Function depthfunc - - The depth value of the pixel being drawn is compared to the depth value currently in the depth-buffer using this function. If the test passes then the pixel is drawn to the Frame-Buffer. If the test fails the pixel is discarded and no changes are made to the Frame-Buffer.
  • Less Than less -
  • Less Than or Equal lessorequal -
  • Equal equal -
  • Greater Than greater -
  • Greater Than or Equal greaterorequal -
  • Not Equal notequal -
  • Always always -

Depth Test

Depth-Testing is comparing the depth value of the pixel being drawn with the pixel currently in the Frame-Buffer. A pixel that is determined to be in-front of the pixel currently in the Frame-Buffer will be drawn over it. Pixels that are determined to be behind the pixel currently in the Frame-Buffer will not be drawn. Depth-Testing allows geometry in a 3D scene to occlude geometry behind it, and be occluded by geometry in-front of it regardless of the order the geometry was drawn.

For a more detailed description of Depth-Testing, refer to the Depth-Test article.


Write Depth Values depthwriting - If Write Depth Values is on, pixels that pass the depth-test will write their depth value to the Depth-Buffer. If this isn't on then no changes will be made to the Depth-Buffer, regardless of if the pixels drawn pass or fail the depth-test.

Discard Pixels Based on Alpha alphatest - This enables or disables the pixel alpha test.

Keep Pixels with Alpha alphafunc - - This menu works in conjunction with the Alpha Threshold parameter below in determining which pixels to keep based on their alpha value.
  • Less Than less -
  • Less Than or Equal lessorequal -
  • Greater Than greater -
  • Greater Than or Equal greaterorequal -
Alpha Threshold alphathreshold - This value is what the pixel's alpha is compared to to determine if the pixel should be drawn. Pixels with alpha greater than the Alpha Threshold will be drawn. Pixels with alpha less than or equal to the Alpha Threshold will not be drawn.

Wire Frame wireframe - - Enables and disables wire-frame rendering with the option of OpenGL Tesselated or Topology based wireframes.
  • Off off -
  • OpenGL Tesselated Wire Frame tesselated -
  • Topology Wire Frame topology -

Alpha Test

Alpha-testing allows you to choose to draw or not draw a pixel based on its alpha value.


Line Width wirewidth - This value is the width that the wires will be. This value is in pixels.

Cull Face cullface - - Selects which faces to render.
  • Use Render Setting userender - Use the render settings found in the Render or Render Pass TOP.
  • Neither neither - Do not cull any faces, render everything.
  • Back Faces backfaces - Cull back faces, render front faces.
  • Front Faces frontfaces - Cull front faces, render back faces.
  • Both Faces bothfaces - Cull both faces, render nothing.
Polygon Depth Offset polygonoffset - Turns on the polygon offset feature.

Offset Factor polygonoffsetfactor -

Offset Units polygonoffsetunits -

Wire Frame

The wire-frame feature will render the geometry as wire-frame, using the actual primitive type used in the render. What this means is surfaces like Metaballs, NURBs and Beziers will become a wire-frame of the triangles/triangle-strips used to render them (since these types of primitives can't be natively rendered in OpenGL).


Cull Face

The cull face parameter will cull faces from the render output. This can be used as an optimization or sometimes to remove artifacts. See Back-Face Culling for more infomation.


Polygon Depth Offset

This feature pushes the polygons back into space a tiny fraction. This is useful when you are rendering two polygons directly on-top of each other and are experiencing Z-Fighting. Refer to Polygon Depth Offset for more information. This is also an important feature when doing shadows.


Info CHOP Channels

Extra Information for the Point Sprite MAT can be accessed via an Info CHOP.

Common MAT Info Channels

Common Operator Info Channels

  • total_cooks - Number of times the operator has cooked since the process started.
  • cook_time - Duration of the last cook in milliseconds.
  • cook_frame - Frame number when this operator was last cooked relative to the component timeline.
  • cook_abs_frame - Frame number when this operator was last cooked relative to the absolute time.
  • cook_start_time - Time in milliseconds at which the operator started cooking in the frame it was cooked.
  • cook_end_time - Time in milliseconds at which the operator finished cooking in the frame it was cooked.
  • cooked_this_frame - 1 if operator was cooked this frame.
  • warnings - Number of warnings in this operator if any.
  • errors - Number of errors in this operator if any.


TouchDesigner Build: