0 votes

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

in Engine by (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

by (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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.