hey guys, I am trying to run some samples after building the src and I am getting:
An exception has occured: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library /home/vargasj/dev/ogre-next/cmake-build-debug/lib/RenderSystem_GL3Plus_d. System Error: /home/vargasj/dev/ogre-next/cmake-build-debug/lib/RenderSystem_GL3Plus_d.so.2.2.5: cannot open shared object file: No such file or directory in DynLib::load at /home/vargasj/dev/ogre-next/OgreMain/src/OgreDynLib.cpp (line 112)
What am I missing? =)
I'm struggling to find why I can't assign the Marble material to my test cube. The Ogre log says:
Parsing script PbsMaterials.material
I use:
auto et{m_staticEntities.emplace(ann.id, ann.meshName)};
ann.gfxEntity = &*et;
auto& sceneMgr{m_renderer.sceneManager()};
auto item{sceneMgr.createItem(ann.meshName,
Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME, Ogre::SCENE_DYNAMIC)};
item->setMaterialName("Marble");
auto node{sceneMgr.getRootSceneNode(Ogre::SCENE_DYNAMIC)
->createChildSceneNode(Ogre::SCENE_DYNAMIC)};
node->attachObject(item);
et->sceneNode = node;
Yet it tells me:
Can't assign material Marble because this Material does not exist. Have you forgotten to define it in a .material script?
This is the file I'm loading: https://github.com/OGRECave/ogre-next/blob/master/Samples/Media/2.0/scripts/materials/PbsMaterials/PbsMaterials.material
Hi! It's strange the log says the script is being parsed but then it's not found.
The most reasonable explanation I can think of is that you're creating the item before calling initialiseAllResourceGroups
Or for some reason Hlms::destroyDatablock is being called on that material before it is assigned. (that would be very strange)
Moreover, how does Ogre know/decide whether to render something with PBS or Unlit at all?
That's in the material script. As the scipt says:
'hlms Marble pbs'
The last word could be either pbs or unlit, and that tells Ogre which implementation you wish to use.
OH Wait!!!
I realize now. You're calling setMaterialName, you should be calling setDatablockOrMaterialName
.
Hlms materials are called 'datablocks' to distinguish v1-era materials from the new ones.
Btw take a look at the 2.1+ FAQ
http://wiki.ogre3d.org/Ogre+2.1+FAQ
It contains solutions for common issues such as this one (e.g. see questions "I've added a Point/Spot light but it won't show up." and "I'm creating custom geometry but it shows black/white with PBS."
BasicTutorial1
. So I literally have it in my main file. When I launch the app the logs look fine but the window is not showing. So basically the app is not responding. I have attached the log:Hi, I'm having problems with updating a compute program named constant (v. 1.12.5). The value gets updated the first time but not after that. I have verified this with Nvidia Nsight.
What I'm doing is that I'm trying to update a particle buffer in a compute shader. The particles have an age and the age is increased every frame with the time since the last frame which is passed to the shader as an uniform.
Here is how I create my compute compositor:
// Creating a compute & render compositor
auto compositor = Ogre::CompositorManager::getSingleton().create(COMPUTE_COMPOSITOR_NAME, RESOURCE_GROUP_NAME);
Ogre::CompositionTechnique* technique = compositor->createTechnique();
technique->getOutputTargetPass();
Ogre::CompositionTargetPass* compositionTargetPass = technique->getOutputTargetPass();
compositionTargetPass->setInputMode(Ogre::CompositionTargetPass::InputMode::IM_NONE);
// Creating the compute pass
m_computeCompositionPass = compositionTargetPass->createPass(Ogre::CompositionPass::PT_COMPUTE);
m_computeCompositionPass->setMaterialName(COMPUTE_MATERIAL_NAME);
m_computeCompositionPass->setThreadGroups(Ogre::Vector3i(2, 0, 0));
// Rendering the contents of the scene after compute the pass
compositionTargetPass->createPass(Ogre::CompositionPass::PT_RENDERSCENE);
// Activating the compositor
Ogre::CompositorManager::getSingleton().addCompositor(m_viewport, COMPUTE_COMPOSITOR_NAME);
Ogre::CompositorManager::getSingleton().setCompositorEnabled(m_viewport, COMPUTE_COMPOSITOR_NAME, true);
Here is how I try to update the named constant for my compute material every frame. The uniform value does not change each frame like it's supposed to.
// udt is supposed to be the time since the last frame but putting in a frame dependent value instead for debugging. Nsight shows that this value does not change between frames.
m_computeCompositionPass->getMaterial()->getTechnique(0)->getPass(0)->getGpuProgramParameters(Ogre::GPT_COMPUTE_PROGRAM)->setNamedConstant("udt", callCount * .001f);
callCount++;
Mesh
's AABB after creating an Item
from it and adding that to the scene. But it doesn't work. I tried calling notifyStaticAabbDirty()
afterwards with a static mesh and I also tried making it a dynamic one. I'm tracking the AABB with a WireAabb
. Now either that one is not updating the visuals or the AABB really does not bother to change. Any ideas?
Hello, I'm trying to get instancing to work but struggling (v. 1.12.9). I have a very simple mesh with no animations and I'm basically aiming to call glDrawElementsInstanced for this mesh with some instance count.
This is what I've tried thus far:
Creating an instance manager with instance count 1000:
Ogre::InstanceManager* m_instanceManager = m_sceneManager->createInstanceManager(INSTANCE_MANAGER_NAME, MESH_NAME, RESOURCE_GROUP_NAME, Ogre::InstanceManager::HWInstancingBasic, 1000);
I've created multiple instanced entitys that use this instance manager like below. The material is copied from the same material for each instanced entity.
Ogre::InstancedEntity* instancedEntity = m_instanceManager->createInstancedEntity(materialName);
Ogre::SceneNode* node = m_sceneManager->getRootSceneNode()->createChildSceneNode();
node->attachObject(instancedEntity);
The issues that I have are...
I think I'm doing pretty much the same stuff as in the instancing sample. If someone knew how to set the right instance count I would be really grateful.
Thanks for replying @paroj. I don't quite understand what you mean by using the same material.
I tried to use the same material for every instanced entity I create and this will give me no glDrawElementsInstanced calls.
Additionally I don't quite see how to update instanced entity specific shader uniforms without cloning the original material and giving every instanced element a clone.
How I did the cloning was:
Ogre::String materialName = Ogre::StringUtil::format("CloneMaterial%d", m_instancedEntityCounter);
Ogre::MaterialManager::getSingleton().getByName("OriginalMaterial", RESOURCE_GROUP_NAME)->clone(materialName);
materialName refers to the code in my previous post.
I looked at the samples a bit more and it looks as if the instancing samples might not produce the kind of instancing I'm trying to achieve.
What I'm trying to do is draw the same mesh multiple times with a single call of glDrawElementsInstanced with some number of instances.
Later in shaders I'd use gl_InstanceID to determine which instance is being drawn and operate on that.
gl_InstanceID is never used in the samples though.
Additionally I don't quite see how to update instanced entity specific shader uniforms without cloning the original material and giving every instanced element a clone.
see https://ogrecave.github.io/ogre/api/latest/_what_is_instancing.html#InstancingCustomParameters
you must not clone the material.
Only the "HW Basic" method will give you a gl_InstanceID. The instanced matrices will be still passed through a "attribute" though.