• 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 EV3RSTORM · Nov 09, 2014 at 08:25 AM · blenderglassrealisticrefraction

Creating a realistic crystal

I am trying to import a test object that I made in unity. It is a simple glass material that refracts light and has a displacement texture (to give it imperfections) and I wanted to know if there was a way I could import this into unity (or at least create something similar). I have a picture of the objects setup below (the red object is a test object that I put behind the crystal to make sure that it was refracting light correctly).alt textalt text

screenshot 2014-11-08 17.30.36.png (506.7 kB)
screenshot 2014-11-08 17.39.18.png (69.4 kB)
Comment
Add comment · Show 5
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 AlwaysSunny · Nov 08, 2014 at 10:47 PM 0
Share

You can't bring Blender shaders into Unity. (Wouldn't that be nice?) You'll need a shader which accomplishes as much of your original intent as possible. To a certain reasonable extent, you can fake light refraction and displacement with a real-time graphics shader. I'd go hunting for your keywords + unity + shader, but you may well have to write it yourself.

avatar image EV3RSTORM · Nov 08, 2014 at 10:53 PM 0
Share

if I have to make my own shader do you have any recommendations as to how I should approach making a shader that does what I would like to achieve (I have never programmed a shader and I have no idea how to make one or how they work)?

avatar image AlwaysSunny · Nov 08, 2014 at 11:05 PM 2
Share

Learning to write shaders for unity is no small undertaking. Frankly, unless this effect is critical for proceeding with your game, I'd highly recommend using a placeholder transparent shader until you're ready to approach the learning process. Or it's possible you can find an existing shader, free or paid, which does what you need. Start with the documentation for shaders, which includes a fairly comprehensive overview.

avatar image antx · Nov 09, 2014 at 09:12 AM 0
Share

perhaps search the unity asset store for shaders. Its quite possible that you find something there that works for you. You might habe to play around a little with settings and textures, but it is sure worth a look. If not in the asset store you could also simply google for unity shaders.

avatar image MrSoad · Nov 09, 2014 at 12:14 PM 0
Share

If you have Unity Pro you might want to look at the :

FX/Glass/Stained BumpDistort

shader and see if you can work with that. Like Sunny says I would try and go with one that exists rather than writing your own, I've had very mixed results when trying and find it far from easy. The shader syntax is like a nightmare version of CSS. It is definitely a specialist skill.

You can bake out your texture and normal map in Blender and then import them for use with this shader.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by tanoshimi · Nov 09, 2014 at 08:29 AM

I assume you meant to write that you created this object in Blender, not Unity.

You'll have to create a Unity shader that replicates the functionality of the Blender shader shown. These are good places to start (both free)

https://www.assetstore.unity3d.com/en/#!/content/729

https://www.assetstore.unity3d.com/en/#!/content/3

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Multiple Cars not working 1 Answer

Creating realistic lantern (glass) 0 Answers

How to fix distorted model in unity 1 Answer

Can't use old Animation component 0 Answers

Light Refraction, Glass, and Marbles 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