Experimental:GLSL Copy POP

From Derivative
Jump to navigation Jump to search

Summary
[edit]

The GLSL Copy POP lets you make copies of the geometry of the first input POP, and apply custom GLSL code to each copy.

If the template input (second input) is not connected, the "number of copies" parameter determines the number of copies.

If the template input is connected, the number of copies is determined by the number of points in the template. A copy is created at each point.

One compute compute shader is run for each element type (points, vertices, primitives) of a copy. Attributes to output are specified in the Output Attributes parameter. A valid points compute shader is required.

For vertices, a custom compute shader is optional, the default compute shader updates the index buffer and copies the input vertex attributes to the output.

For primitives, a custom compute shader is optional, the default compute shader updates extra buffers required for line strips, primitive groups, and copies the input primitive attributes to the output.

See default commented shader DATs for available helper functions and example usage.

Refer to the Write GLSL POPs article for more info on using this POP.

PythonIcon.pngglslcopyPOP_Class


Parameters - GLSL Page

Number of Copies ncy -

Points Compute Shader ptcomputedat -

Point Output Attributes ptoutputattrs - -
  • * * -

Verts Compute Method vertcomputemethod - -
  • Default default -
  • Custom Shader custom -

Verts Compute Shader vertcomputedat -

Vert Output Attributes vertoutputattrs - -
  • * * -

Prim Compute Method primcomputemethod - -
  • Default default -
  • Custom Shader custom -

Prim Compute Shader primcomputedat -

Prim Output Attributes primoutputattrs - -
  • * * -

Append Dimension dimension - -
  • When Template Points / Copies > 1 morethanone -
  • Always always -

TDSimplexNoise() simplexnoise - - Pick between Performance vs Quality Simplex noise. Performance mode picks the existing TDSimplexNoise(). Quality noise reduces certain artifacts and axis alignment issues with the existing simplex noise at the cost of speed.
  • Performance performance - Performant noise.
  • Quality quality - Quality noise.


Parameters - Create Attributes Page

New Attribute attr -
New Attribute Class attr0class - -
  • Point point -
  • Vertex vertex -
  • Primitive primitive -

New Attribute Name attr0name - -
  • Custom custom -
  • N n -
  • Color color -
  • Tex tex -
  • PointScale pointscale -
  • LineWidth linewidth -

Custom Name attr0customname -

New Attribute Type attr0type - -
  • float float -
  • double double -
  • int int -
  • uint uint -
  • dir dir -
  • dbl dir ddir -

New Attribute Number of Components attr0numcomps - -
  • 1 1 -
  • 2 2 -
  • 3 3 -
  • 4 4 -

Array attr0isarray -

New Attribute Array Size attr0arraysize -

Matrix Attribute matattr -
Matrix Attribute Class matattr0class - -
  • Point point -
  • Vertex vertex -
  • Primitive primitive -

Custom Matrix Name matattr0name -

Rows matattr0numrows -

Columns matattr0numcols -

Array matattr0isarray -

Array Size matattr0arraysize -

Qualifier matattr0qualifier - -
  • None none -
  • Transform Matrix transformMatrix -


Parameters - Vectors Page

Vector vec -
Name vec0name -

Type vec0type - -
  • float float -
  • vec2 vec2 -
  • vec3 vec3 -
  • vec4 vec4 -
  • double double -
  • dvec2 dvec2 -
  • dvec3 dvec3 -
  • dvec4 dvec4 -
  • int int -
  • ivec2 ivec2 -
  • ivec3 ivec3 -
  • ivec4 ivec4 -
  • uint uint -
  • uvec2 uvec2 -
  • uvec3 uvec3 -
  • uvec4 uvec4 -

Value vec0value - -
  • Value vec0valuex -
  • Value vec0valuey -
  • Value vec0valuez -
  • Value vec0valuew -


Parameters - Samplers Page

Sampler sampler -
Name sampler0name -

TOP sampler0top - -
Extend U sampler0extendu - -
  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend V sampler0extendv - -
  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Extend W sampler0extendw - -
  • Hold hold -
  • Zero zero -
  • Repeat repeat -
  • Mirror mirror -

Filter sampler0filter - -
  • Nearest Pixel nearest -
  • Interpolate Pixels linear -


Parameters - Arrays Page

Array array -
Name array0name -

Type array0type - -
  • float float -
  • vec2 vec2 -
  • vec3 vec3 -
  • vec4 vec4 -

CHOP array0chop -


Parameters - Matrices Page

Matrix matrix -
Name matrix0name -

Matrix matrix0value -


Parameters - Temp Buffers Page

Temp Buffer tempbuffer -
Name tempbuffer0name -

Initial Value tempbuffer0initval -


Parameters - Constants Page

Constant const -
Name const0name -

Value const0value -


Parameters - POP Buffers Page

Buffer buffer -
POP buffer0pop -

Attribute Class buffer0attrclass - -
  • Point point -
  • Vertex vertex -
  • Primitive primitive -

Attribute buffer0attr -

Name buffer0name -


Parameters - Common Page

Bypass bypass -

Delete Input Attributes delinputattrs -

Parameter Color Space parmcolorspace - - Controls how all color parameters on this node are interpreted. The color values as treated as being in the selected color space, and are converted to the Working Color Space before they are used as part of the node's operation. Note that this does not change the color space of the node itself, as that is always in the Working Color Space.
  • sRGB srgb - sRGB color space, with sRGB transfer function. Considered an SDR color space with respect to Reference White.


  • sRGB - Linear srgblinear - sRGB color space, with linear transfer function. Considered an SDR color space with respect to Reference White.


  • Rec.601 (NTSC) rec601ntsc - Rec.601 with NTSC primaries color space, with Rec.601 transfer function. Considered an SDR color space with respect to Reference White.


  • Rec.709 rec709 - Rec.709 color space, with Rec.709 (same as Rec.2020) transfer function. Considered an SDR color space with respect to Reference White.


  • Rec.2020 rec2020 - Rec.2020 color space, with Rec.2020 (same as Rec.709) transfer function. Considered an HDR color space with respect to Reference White.


  • DCI-P3 dcip3 - DCI-P3 color space, with D65 white point and 2.6 gamma transfer function. Considered an HDR color space with respect to Reference White.


  • DCI-P3 (D60) dcip3d60 - DCI-P3 "D60 sim" color space, with D60 white point, and 2.6 gamma transfer function. Considered an HDR color space with respect to Reference White.


  • Display-P3 (D65) displayp3d65 - Display-P3 color space, with D65 white point, and sRGB gamma transfer function. Considered an HDR color space with respect to Reference White.


  • ACES2065-1 aces2065-1 - ACES 2065-1 (also known as ACES AP0) color space, with a linear gamma transfer function. Considered an HDR color space with respect to Reference White.


  • ACEScg acescg - ACEScg (also known as ACES AP1) color space, with a linear gamma transfer function. Considered an HDR color space with respect to Reference White.


  • Passthrough passthrough - When selected, the color values will be used as-is in the operation, without any modification or attempt to convert them into the Working Color Space.

Parameter Reference White parmreferencewhite - - When converting a parameter color value to the Working Color Space, this controls how it should be treated with respect to Reference White. If the Working Color Space is the same Reference White, then no adjustment is done. If they are different, then the Reference White level (brightness) of this color will be adjusted to the range expected by the Working Color Space. For example if the project is set to have a SDR Reference White of 120 nits, and the HDR Reference White is 80 nits, then a color of (1, 1, 1), which is 120 nits in the SDR color space, will be converted to be (1.5, 1.5, 1.5), which is 120 nits still in the HDR Working Color Space.
  • Default For Color Space default - Will use either the SDR or the HDR Reference White, based on the color space selected.


  • Standard (SDR) sdr - Will treat the Parameter Color Space as SDR for it's reference white value.


  • High (HDR) hdr - Will treat the Parameter Color Space as HDR for it's reference white value.

Operator Inputs

  • Input 0: -
  • Input 1: -


Info CHOP Channels

Extra Information for the GLSL Copy POP can be accessed via an Info CHOP.

Common POP 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:

POPs
Experimental:Accumulate • Experimental:Analyze • Experimental:Attribute Combine • Experimental:Attribute Convert • Experimental:Attribute • Experimental:Blend • Experimental:Box • Experimental:Cache Blend • Experimental:Cache • Experimental:Cache Select • Experimental:CHOP to • Experimental:Circle • Experimental:Convert • Experimental:Copy • Experimental:CPlusPlus • Experimental:Curve • Experimental:DAT to • Experimental:Delete • Experimental:Dimension • Experimental:DMX Fixture • Experimental:DMX Out • Experimental:Extrude • Experimental:Facet • Experimental:Feedback • Experimental:Field • Experimental:File In • Experimental:Force • Experimental:GLSL Advanced • Experimental:GLSL Copy • Experimental:GLSL Create • Experimental:GLSL • Experimental:GLSL Select • Experimental:Grid • Experimental:Group • Experimental:Histogram • Experimental:Import Select • Experimental:In • Experimental:Limit • Experimental:Line Break • Experimental:Line Divide • Experimental:Line Metrics • Experimental:Line • Experimental:Line Smooth • Experimental:Line Thick • Experimental:Lookup Attribute • Experimental:Lookup Channel • Experimental:Lookup Texture • Experimental:Math Combine • Experimental:Math Mix • Experimental:Math • Experimental:Merge • Experimental:Neighbor • Experimental:Noise • Experimental:Normal • Experimental:Normalize • Experimental:Null • Experimental:Out • Experimental:Particle • Experimental:Pattern • Experimental:Phaser • Experimental:Point File In • Experimental:Point Generator • Experimental:Point • Experimental:Points, Vertices and Primitives in s • Experimental:Polygonize • Experimental:Primitive • Experimental:Projection • Experimental:Proximity • Experimental:Quantize • Experimental:Random • Experimental:Ray • Experimental:Rectangle • Experimental:ReRange • Experimental:Revolve • Experimental:Select • Experimental:Skin Deform • Experimental:Skin • Experimental:SOP to • Experimental:Sort • Experimental:Sphere • Experimental:Sprinkle • Experimental:Subdivide • Experimental:Switch • Experimental:Texture Map • Experimental:TOP to • Experimental:Topology • Experimental:Torus • Experimental:Trail • Experimental:Transform • Experimental:Trig • Experimental:Tube • Experimental:Twist