module

Emerald::Docs::NODES::VideoPlayer3D

EmeraldVideoPlayer3D (3D In-World Node)

Executive Summary & Key Topics

Topic Method / Anchor Description
Overview .topic_01_overview Introduction to EmeraldVideoPlayer3D node.
Mapping onto 3D Mesh Materials .topic_02_mapping_to_materials Binding dynamic video textures to 3D materials.

Class methods

topic_01_overview

Overview: Introduction to EmeraldVideoPlayer3D node.

EmeraldVideoPlayer3D extends Node3D to bring LibVLC video playback into 3D game environments. It manages an ImageTexture that can either be rendered automatically via an attached Sprite3D or mapped onto any 3D mesh material (StandardMaterial3D.albedo_texture).

Source
topic_02_mapping_to_materials

Mapping onto 3D Mesh Materials: Binding dynamic video textures to 3D materials.

node InGameCinemaScreen < Node3D do
  def _ready : Void
    # Create 3D player without internal Sprite3D
    player = EmeraldVideoPlayer3D.new
    player.create_sprite3d = false
    player.source = "res://videos/security_feed.mp4"
    player.loop = true
    player.play
    add_child(player)

    # Assign player's dynamic video texture to mesh material
    mesh_node = get_node_as(Godot::MeshInstance3D, "ScreenMesh")
    if mat = mesh_node.get_active_material(0).as?(Godot::StandardMaterial3D)
      mat.albedo_texture = player.video_texture
    end
  end
end
Source