Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 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 kmw4988 · Apr 05, 2018 at 07:54 AM · shadowmap

How to make Shadow map?

Hi, Shadow from the rendering environment, such as below image, should be saved as a Shadow map. I have tried for a long time, but I can not do it. Please tell me how.

Thank you.

alt text

render.png (16.7 kB)
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

5 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by sacrai · Apr 10, 2018 at 01:57 PM

Hi, have a look here: https://docs.unity3d.com/ScriptReference/Rendering.CommandBuffer.SetShadowSamplingMode.html

The sample of code do a copy of a shadowmap in a RenderTexture.

Comment
Add comment · Show 5 · 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 kmw4988 · Apr 13, 2018 at 07:03 AM 0
Share

Hi, thanks to your reply. I tried to code of the link you uploaded but it does not work well and I ask again. First, I created the sample code as a script in Unity, then created a camera and inserted a script into the inspector. And then, I put the light and put the render texture into the camera Target Texture like Camera.PNG below. alt text

Before the game starts, it looks like RenderTexture.PNG below. alt text

After the game starts, it looks like RenderTextureStart.PNG as shown below.

Is this correct? Can you tell me how to do it?

Thanks.

camera.png (40.0 kB)
rendertexture.png (43.3 kB)
avatar image kmw4988 kmw4988 · Apr 13, 2018 at 11:26 AM 0
Share

After the game starts, it looks like RenderTextureStart.PNG as shown below. alt text Is this correct? Can you tell me how to do it?

Thanks.

rendertexturestart.png (35.9 kB)
avatar image sacrai · Apr 13, 2018 at 08:55 AM 0
Share

Hi, I can not see the pictures you post, but normally, you have a texture divide in 2 or 4 depends on the number of shadow waterfall, and you have the depth of the texture of the light point of view . $$anonymous$$aybe by comparing the distance between each point of your floor and the light with the data in the RenderTexture you will have the shadowmap you want to have?

(I'm not sure, but I think that the renderTexture is the ratio between the distance and the shadowdistance)

I hope its can help you

avatar image kmw4988 sacrai · Apr 13, 2018 at 11:08 AM 0
Share

Sorry, I uploaded the images again. Now I have a problem with how to use the script.

avatar image sacrai kmw4988 · Apr 13, 2018 at 12:00 PM 0
Share

You don't need to set a RenderTexture on the camera. The depth texture of the light is saved in m_ShadowmapCopy in the script.

$$anonymous$$aybe you can add a getter on this variable.

avatar image
0

Answer by Melissaeaton · Apr 05, 2018 at 01:37 PM

The thought behind shadow mapping is very straightforward: we render the scene from the light's perspective and all that we see from the light's point of view is lit and all that we can't see must be in shadow. Envision a story segment with an extensive box amongst itself and a light source. Since the light source will see this container and not the floor area when looking toward its that particular floor segment ought to be in shadow.

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
avatar image
0

Answer by kevinkruse26 · Apr 17, 2018 at 03:12 PM

The basic shadowmap set of rules is composed in passes. First, the scene is rendered from the point of view of the light. Simplest the depth of every fragment is computed. Subsequent, the scene is rendered as traditional, however with a further check to see it the present day fragment is in the shadow.

The “being inside the shadow” test is honestly pretty easy. If the current pattern is in addition from the light than the shadowmap on the identical point, this means that the scene consists of an object this is in the direction of the mild. In different words, the contemporary fragment is within the shadow.

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
avatar image
0

Answer by caretipscoronavirus · Sep 27, 2020 at 09:33 AM

Good to see you here, good information for us, are you interest to What Games You Can Play?,I really like this post, I search this topic to many time on web but not find best article like this, are you interest to Video Game to Play With Your Kids

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
avatar image
0

Answer by ahsanalisaqib · Oct 29, 2020 at 10:09 AM

Very Infomative Article i like this Visit This WebSite: HadayatOnline for Daily Hadith Updates & Sahih Sitta Hadees

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

86 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Sampling the cascaded shadow maps in a shader 2 Answers

How to get pixelated shadows? 0 Answers

How to store directional light shadowmap? 1 Answer

Is it possible for Shuriken Billboard particles to receive shadows from shadow maps? 0 Answers

Using shadow texture to recieve shadows (on grass) 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