Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 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 flashburn · Mar 17, 2013 at 06:30 PM · raycastscreenpixelbouncereflect

How do i use raycast from a screen point to set a pixels color?

So i want to use raycast from each pixel on the screen to set it's color to the color of which the ray hit. So from each pixel it will send out a ray, the ray will then hit an object and return the color of the point that it hit, then set the pixels color to the RGB levels that were returned. The reason i'm doing this is because once i do i want to be able to set the rays physics to ricochet off of certain objects and take the color of the object it hits after that.

This is so that i can create a mirror effect. Similar to the way your eyes work with reflected light and angles to portray what is in an apposing world.

Anyway, i have a hunch that this is sort of how the "Main Camera" in the scene works in the first place, but i'm not sure. And i also don't know how i would go about setting the physics of the rays created to be able to ricochet off of specifically named objects, or objects with a specific material type.

Any information on this would be very much appreciated. And thank you to anyone who can help me.

Comment
Add comment · Show 6
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 robertbu · Mar 17, 2013 at 07:10 PM 0
Share

You are talking about ray tracing. There are people of have done it, but my guess is that it requires Unity Pro and RenderTextures to make it happen. One video:

http://www.youtube.com/watch?v=88LQeR4Yoqs

avatar image flashburn · Mar 18, 2013 at 03:49 AM 0
Share

That looks really nice. Now i have a few questions. As you said, ray tracing is not included in unity free.

How does the main camera work, if not through ray tracing?

What would happen if you tried to use ray tracing? Would you get an error, or would it just not operate?

how do i go about accessing the code for the prefab for the main camera? i would love to dig into it to see how it works.

avatar image Benproductions1 · Mar 18, 2013 at 04:17 AM 0
Share

Ray tracing is not part of Unity, you have to implement it yourself! Unity renders using polygons, there is no need for raytracing, but it's a good idea to do so, just for learning how it works, I have implemented it myself :) You do not need Unity Pro to do raytracing! Render textures have nothing to do with it! You can just do a Texture2D and GUI it onto the screen. Tio: you can't do raytracing in unity in real time. at full resolution, you will get about 1 frame every 5 seconds Hope this helps :) Benproductions1

avatar image flashburn · Mar 19, 2013 at 03:04 PM 0
Share

Hmm. If ray tracing get's you that low frame rate then how do you guys suppose that video did what they did and had normal frame rate? I mean, i thought that was the best way to go about creating this effect, if there's a better way i would love to know it.

avatar image Benproductions1 · Mar 19, 2013 at 09:46 PM 0
Share

They used some very very very complex shaders to achieve what they did. As far as I know it has not been released. If you need it for many objects simultaneously, you frame-rate is going to be low. The reason it's not low in the video is because the game isn't running, so no screen effects and no scripts running. Also they had a very good computer :)

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

11 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

Related Questions

bouncing light using mirrors,raycast 0 Answers

How to calculate a RigidBody2D's bounce from a collider? 1 Answer

How to retain absolute gameobject size in pixels no matter the resolution? 2 Answers

How I get sizeof pixels of object 1 Answer

Get transparency of one pixel 2 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