Loading...
Searching...
No Matches
score::gfx::TouchHistoryNode Struct Reference

The pointers of an output as a texture: vertexshaderart's touch history (greggman/vertexshaderart, src/js/main.js). More...

Inheritance diagram for score::gfx::TouchHistoryNode:
score::gfx::NodeModel score::gfx::ProcessNode score::gfx::Node

Detailed Description

The pointers of an output as a texture: vertexshaderart's touch history (greggman/vertexshaderart, src/js/main.js).

32 columns, one per pointer slot of PointerState (0 = the mouse or the first finger), 240 rows, one per rendered frame: texel (x, y, pressure, time), x and y in clip space, y up. The newest row is the bottom of the image – v = 0 of IMG_NORM_PIXEL in an ISF and of texture() in a VSA, on every backend – and the top one is 239 frames old, as in WebGL where row 0 is v = 0 (main.js HistoryTexture / CPUHistoryTexture).

The window devices publish it as the texture address touch/history, fed from their touch/points address (Gfx/Window/PointerAddresses.hpp): it is an ordinary texture source, read by whatever is bound or cabled to it.

It draws into the render target of the input it feeds; that input should be 32x240 RGBA32F, NEAREST, which is what the default binding of an image input named touch asks for (ISFProcess.hpp). The draw is a straight copy: the target is cleared to zero and the colour is composited as premultiplied, so all four channels land as they are, time in alpha included.

w is the seconds since this node was created, the same clock for every output; on vertexshaderart it is the art's time uniform.

Public Member Functions

 TouchHistoryNode (std::shared_ptr< PointerState > pointers)
 
NodeRenderer * createRenderer (RenderList &r) const noexcept override
 Create a renderer in a given context for this node.
 
- Public Member Functions inherited from score::gfx::ProcessNode
void process (Message &&msg) override
 Process a message from the execution engine.
 
virtual void process (Timings tk)
 
virtual void process (int32_t port, const ossia::value &v)
 
virtual void process (int32_t port, const ossia::audio_vector &v)
 
virtual void process (int32_t port, const ossia::transform3d &v)
 
void process (int32_t port, ossia::monostate) const noexcept
 
virtual void process (int32_t port, const FunctionMessage &)
 
virtual void process (int32_t port, const ossia::buffer_spec &)
 
bool resetEventPortsAfterFrame () noexcept
 
 Node ()
 
 Node (const Node &)=delete
 
 Node (Node &&)=delete
 
virtual void process (Message &&msg)
 Process a message from the execution engine.
 
void process (int32_t port, const ossia::render_target_spec &v)
 
- Public Member Functions inherited from score::gfx::Node
 Node (const Node &)=delete
 
 Node (Node &&)=delete
 
Node & operator= (const Node &)=delete
 
Node & operator= (Node &&)=delete
 
virtual void renderedNodesChanged ()
 Whenever render nodes are added / removed.
 
virtual void update ()
 
void materialChange () noexcept
 Used to notify a material change from the model to the renderers.
 
bool hasMaterialChanged (int64_t &renderer) const noexcept
 
void renderTargetChange () noexcept
 Used to notify a render target (texture inlet) change from the model to the renderers.
 
bool hasRenderTargetChanged (int64_t &renderer) const noexcept
 
bool hasExplicitRenderTargetSize (int32_t port) const noexcept
 Whether a given port has a user-specified render target size.
 
bool hasExplicitRenderTargetSpecs (int32_t port) const noexcept
 Whether the user set a size or a format on a texture inlet.
 
QSize resolveRenderTargetSize (int32_t port, RenderList &renderer) const noexcept
 
RenderTargetSpecs resolveRenderTargetSpecs (int32_t port, RenderList &renderer) const noexcept
 
virtual void adjustRenderTargetSpecs (int32_t port, RenderTargetSpecs &spec) const noexcept
 
std::optional< RenderTargetSpecs > firstInputRenderTargetSpecs () const noexcept
 What the first texture input asks to be rendered into.
 
void process (int32_t port, const ossia::render_target_spec &v)
 

Public Attributes

std::shared_ptr< PointerState > pointers
 What the history records every frame.
 
const std::chrono::steady_clock::time_point epoch = std::chrono::steady_clock::now()
 
- Public Attributes inherited from score::gfx::ProcessNode
ProcessUBO standardUBO {}
 Every node matching with a score process will have such an UBO.
 
std::vector< int * > m_event_ports
 Values of the EVENT inputs: 1 for the frame they fire in, else 0.
 
- Public Attributes inherited from score::gfx::Node
std::vector< Port * > input
 Input ports of that node.
 
ossia::small_pod_vector< Port *, 1 > output
 Output ports of that node.
 
ossia::flat_map< RenderList *, score::gfx::NodeRenderer * > renderedNodes
 Map associating each RenderList to a Renderer for this model.
 
ossia::flat_map< int32_t, ossia::render_target_spec > renderTargetSpecs
 Render target info.
 
std::atomic_int64_t materialChanged {0}
 
std::atomic_int64_t renderTargetSpecChanged {-1}
 
int32_t nodeId = score::gfx::invalid_node_index
 
bool requiresDepth {}
 

Static Public Attributes

static constexpr int columns = 32
 
static constexpr int rows = 240
 

Additional Inherited Members

- Protected Member Functions inherited from score::gfx::ProcessNode
bool fireEventPort (int32_t port, const ossia::value &v) noexcept
 
- Protected Attributes inherited from score::gfx::NodeModel
std::unique_ptr< char[]> m_materialData
 

Member Function Documentation

◆ createRenderer()

NodeRenderer * score::gfx::TouchHistoryNode::createRenderer ( RenderList &  r) const
inlineoverridevirtualnoexcept

Create a renderer in a given context for this node.

Reimplemented from score::gfx::NodeModel.


The documentation for this struct was generated from the following file: