• 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 TinyLittleCat · Jul 13, 2012 at 10:49 PM · texturechangedynamicdynamicallychanging

Dynamically changing part of a texture v2

After my massive success at getting my question answered really well really quickly - I have another, related question (original post for context - http://answers.unity3d.com/questions/283845/dynamically-changing-part-of-a-texture.html#answer-283848). In that question I asked if I could put a static colour (in that case, purple) over another, and have it work like a torch - getting closer decreases the size, and further away increases it.

I now have a far more ambitious idea. How can I use this torch to show something completely different to the background it is on? - not like putting a colour over the top of it, but rather a different scene.

I'll try to explain with a terrible image.

http://img826.imageshack.us/img826/8356/badexample.jpg - The wall acts as the 'normal' view, and the circle is where the beam of the torch touches the wall - where it touches displays another image (in this case the party scene inside).

I have the wall as the background/normal image. Flash it with the 'magic torch' and it suddenly shows a completely different image 'underneath', in the exact shape of the where the torch 'touches' the wall. Bigger further away, and smaller closer up. It also needs to work with different angles and all that jazz.

I eventually want to do this with objects too, changing them on 'torch' hit but atm, I'm contented with showing a different image underneath.

Thanks in advance, you lovely, lovely people. Sorry for being rubbish -Ollie

P.S Sorry for the terrible picture, again.

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

1 Reply

· Add your reply
  • Sort: 
avatar image

Answer by ScroodgeM · Jul 14, 2012 at 11:20 AM

simply u can draw a background (partyscene) first (below), and then draw a wall second (at front). to make a wall transparent you can use shader like this

shader with transparent lit area

use a simple light to make wall transparent in area and size you need, under the transparent (lighted) wall you'll see another picture.

perfectly to use shader with image replacement depending on lights 8) but this shader you need find or write.

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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

Dynamically Changing the texture of an object 1 Answer

Dynamically changing _part_ of a texture 2 Answers

Best approach to create visual details and add them on top of a skinned mesh (decal, dynamic texture/material, texture painting)? 1 Answer

Dynamically create Texture2D that is readable 2 Answers

clearing dynamic font texture on font size change 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