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 /
  • Help Room /
This question was closed Dec 22, 2015 at 06:56 AM by Le-Pampelmuse for the following reason:

Duplicate by same User: http://answers.unity3d.com/questions/1111514/broken-specular-shader-code-cg.html please update your linked question with your new informations, don't ask new ones.

avatar image
0
Question by awplays49 · Dec 20, 2015 at 05:29 AM · shaderreflectionmirrorcgreflect

How to write a surface shader for realtime reflection? (CG)

I have a specular shader written in CG and I want to make it reflect anything in the environment. Also, it has to be generic, meaning if something moves I want it to change the reflection.

Comment
Add comment · Show 4
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 awplays49 · Dec 20, 2015 at 03:50 PM 0
Share

Good morning. Im back to researching. I am a little let down that not a lot of people know this to the point that Im not receiving anything even overnight. But hey, thats what its all about, patience. Ill keep reading, but in case I get an answer, I want to clarify that I DONT want to use cubemaps, so how did unity create their reflection in their standard shader? I cant seem to weed it out from the 20,000 lines of nonsense you get after compiling the standard shader.

avatar image Eno-Khaon awplays49 · Dec 20, 2015 at 06:34 PM 0
Share

If I'm not mistaken, the reflections used in the Standard shader are all based around Reflection Probes, with a default of using the skybox.

avatar image awplays49 · Dec 20, 2015 at 06:43 PM 0
Share

Hi @$$anonymous$$o $$anonymous$$haon,

Yea I think that could be my answer. But how do I program my CG shader to use the probes?

avatar image Eno-Khaon awplays49 · Dec 21, 2015 at 03:35 AM 0
Share

Unfortunately, that one's a bit tougher for me to answer easily. I haven't really looked into enough detail at the Standard shader yet, except to know it's a horrifying mess of redirections and preprocessor directives.

Granted, it does make sense in order to allow for versatility in the shader(s), but it's still quite easy to lose track of, well, anything with the wild assortment of function calls changing values of their arguments.

0 Replies

  • Sort: 

Follow this Question

Answers Answers and Comments

37 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

Related Questions

Mirror reflection not working as planned 0 Answers

Why does my mirror not reflect my water shader? 0 Answers

Intercept last pass on a surface shader to change RGB of that pixel 0 Answers

Reflecting object through portal and matching exit portal rotation 0 Answers

How to correctly apply direction to reflection from unity_SpecCube0 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