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
0
Question by coastwise · Mar 22, 2011 at 08:18 AM · shadertextureskyboxtiling

How can I tile a texture on a Skybox?

My goal is to have a regular grid displayed on the skybox. The box is stationary and the camera can rotate around inside it, but instead of being seamless sky it actually looks like a box due to the grid.

I've created a texture that I want to tile across each face of the box, but the tiling settings for the material do not work when I choose the RenderFX/Skybox shader.

Tiling does work with the default Diffuse shader, however when this material used as a Skybox only the front and back faces of the box are rendered (since its not actually a skybox material).

Any suggestions? I'm using Unity 3.3.

If I'm going to have to write my own shader anyway, would it be better to do without the texture entirely and define the grid programatically?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by noradninja · Mar 22, 2011 at 12:05 PM

A skybox texture more or less is always projected at the same distance from your character. That way when you move, it looks infinitely far away, like a real sky.

Knowing this, you could cheat and fake the effect, since we also know you can't really tile the texture on a skybox (each of the skybox cubemap textures makes a side).

What I would do is make the tiling texture I wanted, then create a plane and a camera in Unity. Rotate the plane so it faces the camera object. Put the plane on it's own layer, and set the camera you made to only render the layer the plane is on. Scale the plane so it fills the viewport, and make the plane child to the camera that renders it.

Now make that whole assembly a child of the Main Camera. Set the Main camera to render everything BUT the plane layer.

Apply texture to plane, tile as needed.

Now, when you move, the plane will appear to remain stationary while the player and environment will move accordingly. Your plane will always appear to be equidistant from the camera, and you will overcome some skybox limitations. Use multiple planes with some scripting and you can do stuff like fake 2D parallax scrolling effects too!

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 james flowerdew · Mar 22, 2011 at 12:21 PM 0
Share

It's also sometimes a good Idea to just make an inverted cube in your 3D program and use that ins$$anonymous$$d. make it move to the position of your player and not rotate to get the whole "skybox" thingy as noradninja describes. A vertex lit shader set to black in diffuse and white in emissive is pretty good.

avatar image coastwise · Mar 22, 2011 at 12:32 PM 0
Share

"we also know you can't really tile the texture on a skybox"... why not? I realize each texture makes a side of the skybox, but there should be no reason I cant tile a texture onto each side, as demonstrated by using a tiled diffuse material for the skybox.

avatar image
-1

Answer by nick_VisX · May 26, 2011 at 04:20 PM

Sent you an example to support@unity3d.com

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

Shader Tiling Texture Overlapping between X and Z Axes 0 Answers

Projector + custom fragment shader = endless texture draw 2 Answers

Custom skybox Shader uv issue, skybox texture stretching along one axis. 0 Answers

Why not tiling on Shader (Sprite/Diffuse)? Unity 5.4.1 f1 1 Answer

What's the syntax for creating a skybox with a script? 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