Skip to content

Shared Memory

Ayuma Kaminosono edited this page Jun 6, 2019 · 7 revisions

Shared Memory Sample

In this sample, the image acquired by "SceneCapture2D" is displayed as another material via the shared memory.

203fc2438cc4488ddf9567ad67496f63

  1. The SharedMemory sample is in the "SharedMemory" level sharedmemory1

  2. Please open "Box Actor" to see how to implement

Read side implementation

  1. Prepare textures and materials to display the imported image. sharedmemory2

  2. Create an instance of "ObjectDeliverer" and start it. sharedmemory3

  • Set "ProtocolS shared Memory" to "Protocol". MemorySize specifies the texture buffer size.
  • "PacketRule" has "Nodivision" (because it does not divide packets)
  1. Rewrites the texture buffer at the event of fetching data from shared memory sharedmemory4

Write side implementation

  1. Initializes the array for inserting the image pixel buffer of "TextureRenderTarget".
  2. Create an instance of "ObjectDeliverer" and start it.
  • Set "ProtocolS shared Memory" to "Protocol". MemorySize specifies the texture buffer size.
  • "PacketRule" has "Nodivision" (because it does not divide packets)

sharedmemory4

  1. Fetch the pixel buffer from "TextureRenderTarget" at "Event Tick" and write it to shared memory sharedmemory4