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 Trafalgar · Feb 25, 2013 at 03:18 AM · graphicsrendermultipleoutlinehex

Is there any way to render a gameobject multiple times or do a per-hex outline?

Is there any way to render a gameobject multiple times without cloning a prefab repeatedly (which wouldn't be anywhere near as efficient as instancing, I expect) or do a per-hex outline without doing so?

What I'm trying to do is this: I have a bunch of hexes and my intention was to have empty hexes have an outline. So I made a model and texture for that. The buildable area, however, is 2^18 hexes currently. If worst comes to worst I can just make enough of these 'empty space outline' objects to go in the visible area and place them there, then either relocate them as the screen is scrolled, or destroy and recreate them (likely less efficient but easier). (A problem would obviously arise if the user scrolled way out, as more and more would be required, but I could just turn them off at a particular zoom or something)

I'm hoping there's a more efficient way, however. (I've used instancing in XNA previously, and HLSL, but the shaders used in Unity look completely different to me and I'm not sure what's going on in them - and I seem to be locked out of all the useful features due to not having the pro version, so I've avoided messing with the shaders and ignored all the pro-only classes for now)

This is my first question because until now I haven't run into anything I couldn't figure out myself or by googling.

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
Best Answer

Answer by Julien-Lynge · Feb 25, 2013 at 04:22 AM

As you mentioned, shaders would be one way to do it. I'm not sure about your issues with shaders - I didn't think there was anything Unity-Pro-only there, but I could be wrong. As a quick rundown: Unity has 'ShaderLab', which is code that wraps around HLSL/GLSL/Cg shaders. Unity also has its own 'surface shaders', which are just a way to write lighting calculations and have Unity generate the appropriate vertex/pixel shaders. If you're used to HLSL, you shouldn't have any trouble jumping to Cg, which is what the vast majority of (non-surface shader) Unity examples are written in. I suggest checking the Unify Wiki.

However, rather than go to all the trouble of doing it in shaders, you can probably do it pretty easy with meshes. Keep in mind that a single mesh can hold 65536 vertices, so if each hex tile were, say, 24 vertices, you could hold 2730 of them in one mesh / game object / draw call. Just go into your favorite modeling program and create an array from your hex tile, making sure that it doesn't create a new material for each copy, and you're set.

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

10 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

Related Questions

How to get good looking graphics in UNITY 3D.. 1 Answer

Evaluation question 1 Answer

is using OnPostRender to draw textures Pro only? 3 Answers

How Do I Make The "Solar Outline" Effect? 0 Answers

2D Reflections with URP 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