• 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
Question by DaveA · Feb 13, 2011 at 07:54 PM · shadertextureskyboxparameter

What's the syntax for creating a skybox with a script?

I'm trying to make a skybox dynamically, here's a fragment:

  var skymat = new Material (Shader.Find ("RenderFX/Skybox"));
  var wwwf : WWW = new WWW (params[0]);
  yield wwwf;
  skymat.SetTexture("_Front", wwwf.texture);

I get

Material doesn't have a texture property '_Front'

I've also tried 'Front', 'front', and '_front', and variations including (+z) as well

What gives?

Comment

People who like this

0 Show 0
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

2 Replies

  • Sort: 
avatar image
Best Answer

Answer by DaveA · Feb 13, 2011 at 08:08 PM

Was looking at shader source as you (PeterG) were answering. All I had to do was find and download the sources and look into that shader. Simple! This UI is not doing us any favors! I don't like obfuscation. That said, the correct syntax is, for anyone following in my footsteps:

"_FrontTex"

Comment

People who like this

0 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 hg1 · Mar 15, 2011 at 03:46 PM 0
Share

Very helpful - Thanks! (and you probably also need: _BackTex, _LeftTex, _RightTex ... for Skybox)

avatar image

Answer by Peter G · Feb 13, 2011 at 08:05 PM

I haven't looked at the skybox shader, but you need to see the shader's property name. That's the first part of a property, it is normally proceeded by an underscore.

Properties {
     _YouNeedThisValue("Ignore This", 2D) = "" {}
}

If you don't know what it is, then I suggest that you download the Unity buit-in shaders off the Resources page, and look it up.

Comment

People who like this

0 Show 0 · 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

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

How can I tile a texture on a Skybox? 2 Answers

Blending one material/texture/shader to another 1 Answer

Texture stretching on one axis. Skybox Shader help. 1 Answer

How to add transparency to a shader!? 1 Answer

Get a UV texture of a models surface 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