Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by rossstyantsemteq · Jun 13, 2019 at 09:12 AM · shadersrendertexture

CustomRenderTexture how do you get the current pixel?

Ok so obviously I'm missing something. All I want to do - really simple i believe - is: on each Update call to the CustomRenderTexture material i want to take each pixel from the CustomRenderTexture and lerp it towards red so that over a period of time it turns completely red. so... I'm trying ...

 half4 frag(v2f_customrendertexture i) : COLOR
     {
 float2 uv = i.globalTexcoord;

         half4 redColor = {1,0,0,1};
         half4 myPixelColor = tex2D(_MainTex, uv);
         half4 c = lerp(redColor , myPixelColor , 0.99);
         return c;//

where _MainTex is set to the CustomRenderTexture that has the material with this shader on set as its update material. and i call update every frame on the crt. but what i don't see is any iterative change I guess i shouldn't be using _MainTex like that but i can't see where to get the current pixel color from the custom render texture from. I tried _SelfTexture2D but i couldn't get that to work and that's for double buffered ones anyway and i don't believe i need it double buffered for this - right? I'm running this on windows in the Editor.

The way I'm trying to put pixels into the rendertexture is just by turning a camera on and off that draws to it. As soon as I turn off the camera the cube it was drawing into the rendertexture disappears immediately instead of fading to red.

any guidance appreciated! Thanks.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by rossstyantsemteq · Jun 13, 2019 at 09:27 AM

Ah ok... so this does need to be double buffered. because i'm sampling individiual pixels from the preceding result. When i set it to double-buffered and use _SelfTexture2D it works... it fades up from black to red... but when i turn on and off the camera that draws a cube (without clearing) to the render texture - the cube just disappears from the render texture instead of as i would expect staying there and fading out....Hmmmm...

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Sonia120 · Jun 13, 2019 at 11:26 AM

I don't know how to setup a custom render texture shader with Amplify so any advice on this??kroger survey?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by christopher1238 · Jun 18, 2019 at 06:28 AM

Ok alright... so this needs to be twofold cushioned. since i'm inspecting individiual pixels from the former outcome. When I set it to twofold supported and use _SelfTexture2D it works... it blurs up from dark to red... however, when I turn on and off the camera that draws an auto dialer solid shape (without clearing) to the render surface - the 3D shape just vanishes from the render surface rather than as I would expect remaining there and blurring out

,Im not getting it all please help me that how can i fix this issue im unable to setup a customized render texture shader feeling very helpful krogerfeedback

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

120 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Using custom RenderTexture in ImageEffects. 1 Answer

All pixels drawn on my RenderTexture with a Sprite Diffuse material are shown as black instead of the intended texture colour 1 Answer

Render object ID to texture 2 Answers

Additively overlay one camera on another 3 Answers

how to make shader dont blend color with camera background? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges