Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 silviu-georgian77 · Jan 12, 2016 at 04:48 PM · shaderrenderingvertex shader

Refer from Shader to C# code?

Hi there! I am working on a match3 game and I have to make the items from the game render only inside a certain space, but I don't know much about shaders. For example, when I spwan new items, they appear on top of the 1st row of my items matrix and then fall to their position. So I searched for a solution and I think the best solution would be to use a VERTEX AND FRAGMENT shader to prevent the items to be drawn outside the game matrix. The thing is that in a match3 game there are also levels where item slots are missing, aka there are empty places in the matrix where the items must not be drawn. The question: is there a way to reference the positions of these empty slots to the shader?

Comment
Add comment · Show 1
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 Fattie · Jan 12, 2016 at 06:01 PM 0
Share

you can get one million X better answers if you just post a quick screen shot of what you are doing. click Edit and use the "photo" button on the editor

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Fattie · Jan 12, 2016 at 06:05 PM

Good news,

It's almost certainly the case that this has nothing to do with shaders, whatsoever, and you should not touch or worry about shaders in any way!

Good news right! :)

alt text

Simply try turning the renderer on and off, in the Editor. Next, learn how to do that in code - it's very simple (search on here if you have trouble).

Finally note that if you want to have a "frame" which covers like half an object as it say falls in ... just do that! Add a frame on top (i.e. closer to the camera).

I suggest mastering these very simple techniques before worrying about shaders, and I hope it helps!


screen-shot-2016-01-12-at-120212-pm.png (151.4 kB)
Comment
Add comment · 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 silviu-georgian77 · Jan 12, 2016 at 09:17 PM 0
Share

Thanks for the reply. The first method would be useful and very simple, but i was looking for a cooler transition of the elements. In this way, they will pop in and dissappear. The second one is not possible in a match 3 game and no one would use it, taking into account that there is a huge number of possibilities to make a level,with missing slots. So my question question still stands up. I would be greatful if someone could help.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Screen shaders that alter geometry at runtime or through camera 1 Answer

separate vert and frag shader functions in two distinct URP Render Features 0 Answers

Uniform Texture, Rendering Problem 0 Answers

Dynamic Batching not working even adhering to all rules 3 Answers

Can I unpack normal / tangent / uv information in the vertex function in a surface shader? 1 Answer


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