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
1
Question by Jordan Miller 2 · Jan 06, 2011 at 08:10 AM · shader3dtextfog

why 3d text not affected by fog

I want my 3d text objects to be affected by the fog bug its not happening.

I've found a work around but I'm not pleased with it. is there a setting I'm missing or some way to make 3d text easily affected by fog (or get dimmer the farther away I get from it?)

Here's the shader I'm using (its custom made):

Shader "GUI/3D Text Shader" {

Properties { _MainTex ("Font Texture", 2D) = "white" {} _Color ("Text Color", Color) = (1,1,1,1) }

SubShader { Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } Lighting Off Cull Off ZWrite On Fog { Mode Off } Blend SrcAlpha OneMinusSrcAlpha Pass { Color [_Color] SetTexture [_MainTex] { combine primary, texture * primary } } } }

Ps I tried to change the "liting off culling off zwrite on fog {mode off}" to "...{mode on}" but that just made it not work at all.

Also, I found this code:

Fog { Color [_AddFog] }

I added it in under Tags and it didn't give an error, but it didn't change anything.

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

3 Replies

· Add your reply
  • Sort: 
avatar image
3
Best Answer

Answer by Eric5h5 · Jan 06, 2011 at 09:06 AM

Use a material with a shader that has fog in it; the default doesn't (obviously).

Comment
Add comment · Show 2 · 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 Jordan Miller 2 · Jan 06, 2011 at 07:46 PM 0
Share

oh, well I made my own shader (actually copied). I edited my question to put the code in. is there a way I can modify it to have fog affect it?

avatar image Eric5h5 · Jan 06, 2011 at 09:57 PM 0
Share

Just change the fog mode from Off to something else. (On isn't a valid choice; look in the docs: http://unity3d.com/support/documentation/Components/SL-Fog.html)

avatar image
0

Answer by 3dDude · Jan 06, 2011 at 07:58 PM

I dont know an shader code but it seems to me that it should be:

Shader "GUI/3D Text Shader" {

Properties { _MainTex ("Font Texture", 2D) = "white" {} _Color ("Text Color", Color) = (1,1,1,1) }

SubShader { Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } Lighting Off Cull Off ZWrite On Fog { Mode On } Blend SrcAlpha OneMinusSrcAlpha Pass { Color [_Color] SetTexture [_MainTex] { combine primary, texture * primary } } } }

Like I said before I don't really know that much about shaders but you can try that.

Comment
Add comment · Show 2 · 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 Jordan Miller 2 · Jan 06, 2011 at 08:12 PM 0
Share

I tried it and unfortunately it didn't work at all - made all my 3d text pink and gave me an error. I'm looking through other shaders to see what it might be but I can't find any code that could help

avatar image 3dDude · Jan 06, 2011 at 08:18 PM 0
Share

Ok, yeah sorry about that. Like I said, I am not a good shader programer...

avatar image
0

Answer by xilliah · Dec 13, 2011 at 09:48 AM

You're telling it to turn off with

Fog { Mode Off }

Tell it

 Fog { Mode Global }

Global means it will take the settings from the global render settings described in the Unity editor, so of course you need to turn that on and set it to your liking. You can also override the global settings by entering your own settings inside of these brackets, as described at the link shared earlier.

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

1 Person is following this question.

avatar image

Related Questions

Represent Land 3D Area End 0 Answers

Fog effect on shader 0 Answers

Unity 5 Fog not working on Standard Shader Objects 3 Answers

How can i get my quad to only render my texture without stretching it? 1 Answer

Fog of war depth-mask technique 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