0 votes

Is it possible to render video on a sprite or quad? If so, is there an example?

asked Apr 24, 2018 in Engine by johnburkert (12 points)

1 Answer

+1 vote

This can be achieved by using a viewport node.
Add a videoplayer node as a child of a viewport node and use the viewport texture as the texture of the sprite.
You can check the Viewport demos or a demo scene i have prepared (3.x) https://www.dropbox.com/s/qdmos931cxg4364/ViewportVideoDemo.rar?dl=0

answered Apr 25, 2018 by funabab (112 points)

Thanks for the reply. I ended up going with this:

var video = VideoPlayer.new()
video.stream = load("res://video.ogv")
var sprite = Sprite.new()
sprite.add_child(video)
sprite.set_texture(video.get_video_texture())
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.