Git Product home page Git Product logo

Comments (3)

gotmachine avatar gotmachine commented on August 15, 2024

So, to be clear, we are talking about PQSLandControl.OnVertexBuildHeight() ?

This piece of code is indeed quite hard to follow. This pattern of having instance fields being used as local variables shared by multiple methods all over the place is really awful.

Despite this being quite weird, I think sx is designed to be in the [-0.25, 0.75] range. There are way too many places where this is used for this to be a mistake. Since this is mapping to texture UV coordinates, my interpretation is that there is a deliberate intent to have a 90° offset between the texture origin and the 0° longitude.

And in fact, when using those values as UV coordinates, the stock code always does val = Math.Abs(val - Math.Floor(val)) which is equivalent as your modified code to transform back the value to a valid [0, 1] UV range.

I think the actual mistake is indeed PQSLandControl.OnVertexBuildHeight() trying to get back a longitude value from the sx coordinates without accounting for that offset, so your fix makes sense from that PoV.

What I'm unsure of is how this will interact with the "intended" scatter placement. Fixing this like that mean whatever stuff is used to configure the distribution is working with a "the origin is at 90° longitude" assumption, but I guess that's already accounted for by people using this. Still, a confirmation that scatters are actually where they are supposed to be would be nice.

I will implement that fix and try to do a release ASAP.

On what this fix should be described, what is PQSLandControl used for ? Does it only affect scatters distribution or is the class used for other purposes ?

from kspcommunityfixes.

R-T-B avatar R-T-B commented on August 15, 2024

Yes you got the right function. And looking at it I agree with everything you say... just seems very odd a choice of coordinate system.

Will test soon.

from kspcommunityfixes.

R-T-B avatar R-T-B commented on August 15, 2024

Forgot to answer one point: LandControl can do a bit more than scatters. It can do some terrain coloring effects amongst other things. Mainly scatters though.

from kspcommunityfixes.

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.