Git Product home page Git Product logo

Comments (7)

tobspr avatar tobspr commented on May 18, 2024

Hi, yeah, the render pipeline does not expect the camera to be parented to another nodepath.

I will see if I get to implement this for the next Release, in the meantime you can use a task which synchronises the camera position to the desired nodepath.

from renderpipeline.

RodrigoMedeirosRS avatar RodrigoMedeirosRS commented on May 18, 2024

Right! I will wait for you!

Please try to fix soon, because into my controller system, when i update the camera position into task, the results very, very poor.

Thanks for the attetion.

from renderpipeline.

tobspr avatar tobspr commented on May 18, 2024

Make sure the task has the right sort, so that your logic happens first, then the camera position is synchronized, and the render pipeline updates.

The rp updates all have a sort greater zero, so try running your game logic with a sort of -10 and your camera synchronization with a sort of -5 or so.

I am currently in vacation, so I can't do much until next week :)

from renderpipeline.

RodrigoMedeirosRS avatar RodrigoMedeirosRS commented on May 18, 2024

I found the origin of problem!

Analyzing the glitchs, i see they follow a pattern, and they occour's only into skybox, and how many times i test, less glichs occour's. So when i try you manual solution suggestion, i find the origin of error, and a perfect workaround.

The error occour's because the RP cannot get the starter position of camera when his is a child of another thing, and he is getting some memory info trash, and receiving invalid coordinates.

But, if i can set manualy only the original position, the RP can apply any other transformations correctly, and here is the workaround:

base.camera.setPos(self.orb.getPos() + self.playerNP.getPos() + Vec3(0, 2.5, 0))
base.camera.lookAt(self.orb)
base.camera.reparentTo(self.orb)
base.camera.setPos(0,2.5,0)
base.camera.lookAt(self.orb)

Basically, i am manualy setting the camera position into his future child position, then i make it a child, after this, the RP can correctly calculate the camera position and all glich's are solved.

Now i belive is much more easy to you to found a definitive solution ;)

Att. R.M.Lehnemann

from renderpipeline.

RodrigoMedeirosRS avatar RodrigoMedeirosRS commented on May 18, 2024

Only a minor update, i found another error, the cascade shadow map, he can't update correctly the camera position, so when i go so far, the shadow quality become very very poor.

But for this problem the solution is more simple, put a if into the cascade shadow map, if the camera is a child, use the father coordinates.

Note: please consider multiple child levels, bacause into my System the camera is a child of child. :P

from renderpipeline.

RodrigoMedeirosRS avatar RodrigoMedeirosRS commented on May 18, 2024

No more fix is needed, problem as definitely solved.

If you need reparent a camera, instead create a empty node, them use the following command:

base.camera.setTransform(self.EmptyNode.getNetTransform())

Solved. The camera now will recive all transforms of child component.

from renderpipeline.

tobspr avatar tobspr commented on May 18, 2024

Cool, glad to hear you found a solution!

I will leave this PR open though, since I think the render pipeline should automatically be able to detect this (by always using the correct transform)

from renderpipeline.

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.