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
4
Question by zante · Sep 08, 2010 at 10:50 PM · lightmapreflectionmirror

Why does resizing a plane with the lightmap/mirror shader distort the reflection? youtube link included

See the package at

http://www.unifycommunity.com/wiki/index.php?title=MirrorReflectionLightmapped

Surely not being able to resize the plane makes this unusable?

video of the problem in action:

http://www.youtube.com/watch?v=Lhqc_jcYLbs

Comment
Add comment · Show 2
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 Peter G · Sep 08, 2010 at 11:37 PM 0
Share

Have you tried making a bigger plane in your modeler and just applying the shader to that?

avatar image qJake · Sep 09, 2010 at 01:56 AM 0
Share

$$anonymous$$y guess is it has something to do with UV coordinates, from the looks of it, but I'm not 100% sure. I would do as Peter said, and create whatever size plane you need to in a 3D modeling program and just use that - don't rely on the built-in Unity types for advanced things like this. You're supposed to create your own.

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by desov · Oct 04, 2010 at 11:12 PM

Just use Water script from Pro Standard Assets with MirrorReflectionLightmapped shader. Works fine.

Ow, You might want to get rid of refraction section from the script ;)

Comment
Add comment · Show 1 · 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 Jean-Fabre · Oct 20, 2010 at 02:28 PM 0
Share

Had the same problems, this package is a cut down version of the water script itself, so as desov mentionned ( that's how I did too) simply use the normal water script and tweak it, remove water animation, refraction etc, and you will get perfect reflection.

avatar image
1

Answer by Q_B · Nov 30, 2010 at 08:58 AM

The way I solved this problem:

On the MirrorReflection.cs script, add a new variable

public int custom_scale = 1;

Then, on line 95, substitute

//Matrix4x4 mtx = transform.localToWorldMatrix * Matrix4x4.Scale( new Vector3(1.0f/scale.x, 1.0f/scale.y, 1.0f/scale.z) );

Matrix4x4 mtx = transform.localToWorldMatrix * Matrix4x4.Scale( new Vector3(custom_scale/scale.x, custom_scale/scale.y, custom_scale/scale.z) );

Now all you have to do is to put on custom_scale the same value you have on your plane's scale.

This could even be done by referring to the transform.scale component of the object, but I'm in a hurry and haven't implemented it like that yet, so :)

But this way it works. Hope it helps!

(edit)

Ok then, you can also add

public float custom_scale = 1;

instead, and then, lets say, before line 95, add the following

custom_scale = transform.lossyScale.x;

and then the Matrix4x4 code changes stated above.

This way, it will always use your plane's scale (I'm assuming you have a uniform scale on all axis, so just use the x scale)

Hope it helps!

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 zante · Sep 09, 2010 at 11:06 AM

Just imported a plane from max, the rest of the model was made in sketchup. None of the proposed solutions worked.

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 desov · Oct 28, 2010 at 04:39 PM

This might help :

( mirror reflection script) Try to experiment with the value of Clip Plane Offset. Tweek it untill you find the right reflection distance.

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

No one has followed this question yet.

Related Questions

Problem with reflection probe 0 Answers

Which project settings for mirrors? 0 Answers

How to use two reflection cameras in the same scene? 0 Answers

mirror effect reversed side? 1 Answer

Curved Mirror - How to do it? 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