Giter Site home page Giter Site logo

Comments (17)

Ayfel avatar Ayfel commented on July 19, 2024

Can you share your light settings? Baked shadows is one of the main applications of this, so maybe your light settings are not in the right setup. Do you get indirect lighting?

from prefablightmapping.

viknesh2020 avatar viknesh2020 commented on July 19, 2024

Sorry my bad. The question was wrong actually. It works for baked lightmaps. The issue is, there are patches over the object everytime I bake lightmap. In the editor, it looks fine. But when I take a build for my iPad, there are irregular shadows and black patches all over the object. I checked the closed issues and found out that disabling static flag will solve this issue. However, still this issue exists. Screenshots are below for your reference.

IMG_0020
IMG_0019

from prefablightmapping.

Ayfel avatar Ayfel commented on July 19, 2024

Things to check:

-check shader stripping the graphics settings (see the readme of this repo), this affects builds
-try with non compressed light maps
-make sure in the editor that instantiating these objects work fine
-If nothing works I would recommend going as far as creating a scene with instantiated objecs just for testing in device to eliminate the possibility that there is something else in your project affecting the lighting (I see you are in AR so doing a non AR scene with the prefabs simply to check)

from prefablightmapping.

viknesh2020 avatar viknesh2020 commented on July 19, 2024
  • Tried the shader stripping in both custom and automatic. No luck !
  • Tried uncompressed and compressed lightmaps. Both didn't work
  • Created a new scene to instantiate the same prefab in the editor. Worked fine.
  • Tried the same scene in the build, but didn't work. Screenshots below,

Build
Editor

First image is taken from my iPad. I cleared the bake data and reset my lighting tab settings and tried this. Still didn't work.

from prefablightmapping.

Ayfel avatar Ayfel commented on July 19, 2024

Thanks for doing those. What Unity version are you at? Can you send me a minimal project to check? Just that simple scene and prefab and I can check the issue.

from prefablightmapping.

viknesh2020 avatar viknesh2020 commented on July 19, 2024

Thanks for doing those. What Unity version are you at? Can you send me a minimal project to check? Just that simple scene and prefab and I can check the issue.

Sure. I will share you the link. I guess I have to share you the entire project, so that you can have a look at the graphics and lighting settings. Is that ok?

from prefablightmapping.

Ayfel avatar Ayfel commented on July 19, 2024

Sure no problem

from prefablightmapping.

viknesh2020 avatar viknesh2020 commented on July 19, 2024

Here is the link to the entire project. This is a temporary link, so download it as soon as possible. I am using Unity 2019.4.10f1.
Xcode version 12.3. If you need any other information, let me know. Thank you for your help in this.

https://we.tl/t-dUQVWZnhf5

from prefablightmapping.

Ayfel avatar Ayfel commented on July 19, 2024

Ok I got it, but what scene am I checking? There is one called PrefabTest but it doesn't instantiate anything

from prefablightmapping.

Ayfel avatar Ayfel commented on July 19, 2024

Also
I noticed that your chair and table prefabs are disconnected (the one in the scene you had and the one in your Assets have different lighting data so that might be messing with it). I recommend substituting the one in Assets with the one in your scene that works. Drag and drop from the scene into the assets prefab and substitute the prefab, if you are instantiating the prefab in assets that had the wrong data

from prefablightmapping.

viknesh2020 avatar viknesh2020 commented on July 19, 2024

Sorry. The scene that we have to check is 'FurnitureAR'. Also, the scene 'PrefabTest' is having a button at the left corner to instantiate the prefab.

I checked the prefabs again. It was rightly pointing at the lightmap data. So, to double check this, i did the following.

  • Cleared the baked data of the scene 'FurnitureAR'
  • Clicked on the Assets>>Bake Prefab Lightmaps.
  • After baking is complete, got the new Baked lighting data and automatically assigned them to the prefab.
  • Created a new original prefab by dragging and dropping the existing prefab in the scene hierarchy to the assets folder. Assigned those new prefabs to the instantiate script.
  • Built and checked. No luck :(

from prefablightmapping.

Ayfel avatar Ayfel commented on July 19, 2024

I am on a trip right now, but I will check when I get back to my pc. I might need to build to IOS to confirm, but I will get back to you if you haven't fixed it by then

from prefablightmapping.

viknesh2020 avatar viknesh2020 commented on July 19, 2024

I am on a trip right now, but I will check when I get back to my pc. I might need to build to IOS to confirm, but I will get back to you if you haven't fixed it by then

Sure. Thank you so much :)

from prefablightmapping.

viknesh2020 avatar viknesh2020 commented on July 19, 2024

Update: Tried with a different model, to check if the issue is with uv of the model. Still having issue with the new model. Created an empty scene, didn't bake light for the new scene and used the existing prefab. Issue still exists.

from prefablightmapping.

Ayfel avatar Ayfel commented on July 19, 2024

Ok so I have reproduced this issue succesfully in Android. Now the funny part, if I have those two models in the scene already then there is no issue and lighting works properly, also with any new models that I place after
I wonder if there is something funny in those URP shaders...

from prefablightmapping.

Ayfel avatar Ayfel commented on July 19, 2024

I have the feeling its related to URP , looks at this other issue #9

from prefablightmapping.

Ayfel avatar Ayfel commented on July 19, 2024

A very simple workaround seems to be to include those objects in your scene (enabled) really far away or super small. That solves it. Not a permanent solution but that will make it work for now. Still trying to figure it out.

from prefablightmapping.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.