Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OGRE-22] Lighting is incorrect when camera-relative rendering is enabled. #4

Closed
paroj opened this issue Nov 29, 2015 · 7 comments
Closed

Comments

@paroj
Copy link
Member

paroj commented Nov 29, 2015

[reporter="spacegaier", created="Sat, 24 Nov 2012 19:52:36 +0100"]

Original reporter: myint

http://www.ogre3d.org/forums/viewtopic.php?f=4&t=60939

Original Mantis Ticket: http://www.ogre3d.org/mantis/view.php?id=360

@paroj paroj added this to the 1.10.0 milestone Nov 29, 2015
@paroj
Copy link
Member Author

paroj commented Nov 29, 2015

[author="masterfalcon", created="Sat, 30 Mar 2013 08:15:13 +0100"]

I'm unable to reproduce this in the 1.9 branch. Can anyone else confirm?

@paroj
Copy link
Member Author

paroj commented Nov 29, 2015

[author="masterfalcon", created="Fri, 7 Jun 2013 07:04:26 +0200"]

Yeah, I believe this is fixed. You can paste this into BezierPatch.h to test.

BezierPatch.h
#ifndef __BezierPatch_H__
#define __BezierPatch_H__
#include "SdkSample.h"
using namespace Ogre;
using namespace OgreBites;
class _OgreSampleClassExport Sample_BezierPatch : public SdkSample
{
public:
    Sample_BezierPatch()
    {
        mInfo["Title"] = "Bezier Patch";
        mInfo["Description"] = "A demonstration of the Bezier patch support.";
        mInfo["Thumbnail"] = "thumb_bezier.png";
        mInfo["Category"] = "Geometry";
    }
protected:
    bool frameRenderingQueued(const FrameEvent& evt)
    {
for (unsigned int i = 0; i < 4; i++)
{
    topNode->setOrientation(Ogre::Quaternion(Ogre::Radian(Ogre::Degree(i * 90)),
     Ogre::Vector3(0, 0, 1)));
    Ogre::WindowEventUtilities::messagePump();
    mWindow->update();
    // Save to file for later comparison
    std::stringstream ss;
    ss << "render" << i << ".png";
    mWindow->writeContentsToFile(ss.str());
}
        return SdkSample::frameRenderingQueued(evt);
    }
    void setupContent()
    {
mSceneMgr->setCameraRelativeRendering(true);
mCamera->setPosition(0, 0, 200);
mCamera->lookAt(0, 0, 0);
mViewport->setBackgroundColour(Ogre::ColourValue(0., 0., .5));
mSceneMgr->setAmbientLight(Ogre::ColourValue(0.1, 0.1, 0.1));
topNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
Ogre::Light *light = mSceneMgr->createLight("light");
light->setType(Ogre::Light::LT_POINT);
Ogre::SceneNode *lightNode = topNode->createChildSceneNode();
lightNode->attachObject(light);
lightNode->setPosition(50., 0., 50.);
Ogre::Entity *cube = mSceneMgr->createEntity("cube", Ogre::SceneManager::PT_CUBE);
cube->setMaterialName("BaseWhite");
Ogre::SceneNode *cubeNode = lightNode->createChildSceneNode();
cubeNode->attachObject(cube);
cubeNode->setScale(.1, .2, .3);
Ogre::Entity *plane = mSceneMgr->createEntity("plane", Ogre::SceneManager::PT_PLANE);
plane->setMaterialName("BaseWhite");
Ogre::SceneNode *planeNode = topNode->createChildSceneNode();
planeNode->attachObject(plane);
Ogre::Entity *sphere = mSceneMgr->createEntity("sphere", Ogre::SceneManager::PT_SPHERE);
sphere->setMaterialName("BaseWhite");
Ogre::SceneNode *sphereNode = topNode->createChildSceneNode();
sphereNode->attachObject(sphere);
sphereNode->setScale(.5, .5, .5);
    }
    Ogre::SceneNode *topNode;
};
#endif

@paroj
Copy link
Member Author

paroj commented Nov 29, 2015

[author="scrawl", created="Tue, 3 Sep 2013 21:04:57 +0200"]

Pulled 1.9 today, I still get this problem when moving the camera, it looks like the (camera-space) light positions are lagging a frame behind.

@paroj
Copy link
Member Author

paroj commented Nov 29, 2015

[author="scrawl", created="Tue, 3 Sep 2013 21:07:23 +0200"]

Ah - the problem only happens when I'm attaching the camera to a bone.

@paroj
Copy link
Member Author

paroj commented Nov 29, 2015

[author="scrawl", created="Wed, 4 Sep 2013 16:21:06 +0200"]

Could you give a link to the commit that you believe fixed the original problems? That might give me a hint where to start looking why its still happening for bones.

@paroj
Copy link
Member Author

paroj commented Nov 29, 2015

[author="masterfalcon", created="Wed, 4 Sep 2013 16:50:51 +0200"]

I don't know specifically. I was just rechecking bugs and was not able to reproduce this one with the test case provided.

@paroj paroj removed this from the 1.10.0 milestone Jan 10, 2018
@paroj
Copy link
Member Author

paroj commented Jul 19, 2018

does not reproduce with 1.11.2

@paroj paroj closed this as completed Jul 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant