Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411423 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 18, 2024, 09:54:06 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Render Texture Unity5
Pages: [1]
Print
Author Topic: Render Texture Unity5  (Read 1368 times)
Sigma
Level 1
*


View Profile WWW
« on: June 19, 2015, 01:18:28 AM »

Can someone give me a pseudo code or code snippet, for how to use RenderTexture in Unity5? I have a shader that accepts _MainTex as RenderTexture, i created a RenderTexture and linked it through the shader properties. In OnUpdate function i'm doing Graphics.DrawTexture but nothing appears on screen. The way i'm handling RenderTexture might be wrong, need help on how to use RT? All helps are highly appreciated!!!

[Edit]  i have watched lot of tutorials that do render to camera target texture, i'm aware of that. But i want to control what goes into the render texture and the position of the texture being rendered as well. So i just want to draw specific game object textures into it and then apply shader on the render texture. in that case camera target texture is not a recommended one i guess. Any idea on how to do manually without camera target texture? all i need is a pseudo code how to use RT in unity.
Logged

starsrift
Level 10
*****


Apparently I am a ruiner of worlds. Ooops.


View Profile WWW
« Reply #1 on: June 19, 2015, 05:05:20 AM »

http://docs.unity3d.com/ScriptReference/RenderTexture-active.html ?

You also might want to try throwing an error with RenderTexture.isCreated().
/ just started my exploration into Unity myself...
Logged

"Vigorous writing is concise." - William Strunk, Jr.
As is coding.

I take life with a grain of salt.
And a slice of lime, plus a shot of tequila.
Sigma
Level 1
*


View Profile WWW
« Reply #2 on: June 19, 2015, 05:18:48 AM »

http://docs.unity3d.com/ScriptReference/RenderTexture-active.html ?

You also might want to try throwing an error with RenderTexture.isCreated().
/ just started my exploration into Unity myself...

thank you will give it a try
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic