Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 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
1
Question by Haerius · Mar 10, 2015 at 10:53 AM · shader writingdistortion

Combining Fresnel with Distortion shader

Hy there. I am making a explosion shockwave. Since a shockwave is nothing more than compressed air bending the light, a distortion shader would be perfect for this effect. I discovered the Dvornik-Distortion shader which is very good, but is uses a texture map as the distortion input. So I got the idea to combine a Fresnel calculation, generate a B&W texture and feed it into the distortion texture input. But the problem is: I have no funcking clue how to write shaders.... So I was wondering if someone could help me out on this one :)

Well Maybe a picture could help out explain what the problem is:

alt text

A texturemap would only work from a specific point of view. But a fresnel would always give the desired result.

Link to the distortion shader

fresnel.png (412.9 kB)
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

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by isaidkrankify · Aug 21, 2021 at 03:46 AM

For anyone coming to this post in the future, you may be looking for the Spherize node. This is the result of a quick distortion shader setup: A distortion shader bulges the pixels on the edges of the circular plane.


The Spherize node warps the UV into a spherical shape. If you invert the scale, you can invert the effect. Here's my node setup: A Spherize node with a strength of 500 set by a Float input node, which is plugged into the UV input of a Tiling And Offset node with a Tiling value set to -1 via another Float input node. This is then plugged into the Distortion input of the Fragment node.


This Spherize node has a strength value of 500 which is set by plugging a Float input node into the strength input of the Spherize node. Set the strength to whatever works for you; my project requires the object to be very close to the camera.

Next, plug the UV output of the Spherize node into a Tiling And Offset node, then set the Tiling to -1 using another Float input node. This inverts the bulge and scales it, too.


Remember to turn on "Distortion" in your Graph Inspector window in the node editor! Enable "Distortion Only."


image-2021-08-20-204155.png (29.4 kB)
image-2021-08-20-204345.png (104.9 kB)
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

22 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

Related Questions

Combining a distortion and masking shader. 2 Answers

How can i fix this uv tiling/ distortion problem? 2 Answers

unity2d fixed aspect ratio is distorted 1 Answer

Built in Glass Stained Bump distort on Particles 0 Answers

About sound distortion 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