project camera view to texture

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Blopper

Hello, how would you go about projecting a camera view to a texture

:bust_in_silhouette: Reply From: AiTechEye
	var img =  camera.get_viewport().get_texture().get_data()
	var tex = ImageTexture.new()
	tex.create_from_image(img)
	get_node("c").texture = tex

ty seems to be working but perfomance is super bad any idea why

Blopper | 2020-02-23 20:35

in a viewport node you can enable keep_3d_linear, and in materials are flags for shaders, test around with those

AiTechEye | 2020-02-23 22:01

didnt work for me img and tex = null don’t know why

Lolaap14 | 2021-09-29 01:05

reduce the viewport size, cause get_data() function captures the whole screen and converts it to an image which is a time consuming task.

tanimsk | 2021-10-03 16:47