Giter Site home page Giter Site logo

Assert fail on boundary check about lightmapper HOT 5 CLOSED

ands avatar ands commented on September 21, 2024
Assert fail on boundary check

from lightmapper.

Comments (5)

ands avatar ands commented on September 21, 2024 1

Hey :)
Could you clarify what you mean with your question? Can you show me the problem/effect in a screenshot maybe?

If you are talking about the lightmap values outside the UV mapped regions, that's what the dilation image post-processing passes do (lmImageDilate calls). They help to fill in missing light samples (due to invalid camera positions while rendering, e.g. when camera frustums intersect with geometry and "sees" the insides) with values from valid neighbor texels.
It also helps on lower mip map levels of the texture if you use mip mapping. Since mip map levels are downsampled versions of the original texture, texels contain the average of some higher resolution mip level texels. So, if you're sampling a lower resolution mip level at the edge of a piece from your UV map, with dilation you would still get somewhat valid values, instead of an average with possibly completely missing data.
This page tries to describe the problem: http://wiki.polycount.com/wiki/Edge_padding

from lightmapper.

ands avatar ands commented on September 21, 2024 1

Okay, cool :)
I submitted the fix (see attached commit).
Actually, the rasterizer bounding conditions were somewhat inconsistent throughout the code. I had to fix it in some more places.
Thanks a lot for the report! :)

from lightmapper.

ands avatar ands commented on September 21, 2024

Hey, thanks :) I've seen your project and it is pretty cool too!
I'm pretty sure your fix is correct. I will check and integrate it today after work. Thanks for reporting it! :)

Regarding the porting work: At some point I want to make it easier to swap out the parts that depend on the graphics API, so that it would be easier to port the project to other APIs or environments and not end up with a totally custom version of the lib that is hard to update. :)

PS:
I've seen the screenshot you posted of the ambient occlusion feature. If you actually already supply vertex normals for smooth surfaces, you may want to try increasing the last parameter in lmCreate to e.g. ~5.0f or so. It may help to get rid of the flat shaded look (if that is what you want). :)

Have fun!
ands

from lightmapper.

huxingyi avatar huxingyi commented on September 21, 2024

Thanks :D
Separating the graphics API would make integrating much easier, actually, I am a little worried about the upgrade when I was integrating to Qt environment. I am looking forward to the future version of lightmapper.
Thanks for your suggestion, I will try to play the lightmapper options, right now, I just finished the porting work.
And one more question, I see the generated shadow in the texture map looks like expanded a little bit from the boundary border, although the final rendered model looks good, is this right?

from lightmapper.

huxingyi avatar huxingyi commented on September 21, 2024

Thanks for your clear and detailed answer :D now I understood and learned, there is no issues with the expanded shadow at all.

from lightmapper.

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.