Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Matías N. Goldberg
    @matiasgoldberg_twitter

    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.

    The reason it's failing is because setMaterialName only looks for the older v1 materials
    Change the call to setDatablockOrMaterialName and you should be set
    Neonit
    @Neonit
    @matiasgoldberg_twitter Thank you for your answer. I think it works. At least the error message is gone. I can't see it, because apparently I have a lighting issue (cube is just black), although I set an ambient color of (0.5, 0.5, 0.5) and create a light above the cube.
    Matías N. Goldberg
    @matiasgoldberg_twitter
    If the light is not directional (e.g. spot or point) and shadow maps are not enabled, you will have to use Forward+ (there is a sample about that). Since you're still starting up, it's best that you first set that light to directional to check things work as intended

    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."

    Erik Ogenvik
    @erikogenvik
    Hi, there's a bug in Ogre 1.12.12. It's caused by the addition of "mesh->buildEdgeList();" to InstanceManager::unshareVertices, and it affects meshes with shared geometry and LOD. Basically, what happens is that the shared geometry is unshared, and split into separate geometries. But this is only done for the top level mesh (lod=0), the rest of the LOD data is untouched. This leaves the data in an inconsistent state since the lod data now refers to vertices where they were in the shared geometry.
    And when Mesh::buildEdgeList then is called this will lead to a segfault, since it will try to access vertices that are out of bounds.
    9 replies
    Farid
    @dahiri-farid
    Hello everyone! Trying to run 1.12.12 on MacOS. Successfully compiled. I have setup a sample project using simply 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:
    https://www.dropbox.com/s/veophhl6f6e7aei/the%20log?dl=0
    16 replies
    crjc
    @crjc
    Hi - I've set the diffuse texture of a HlmsPbs datablock in Ogre 2.3 to a texture with transparency. What is the simplest way to add a solid colour underneath this texture? I'd like to be able to update the solid colour at any time, too.
    Matías N. Goldberg
    @matiasgoldberg_twitter
    @crjc use HlmsPbsDatablock::setBackgroundDiffuse
    and assign the texture as a detail map diffuse instead of 'just diffuse' texture
    1 reply
    Neomorebirus
    @Neomorebirus
    Hello, does anyone happen to have any experience with compute shaders and shader storage buffer objects or UAVs in Ogre1.12.9? I have a working particle system in a pure OpenGL demo that uses a compute shader to update particles. The particle data is stored in a SSBO. After updating I draw the particles by using the SSBO in the particle vertex shader (with instancing). I’m trying to translate this OpenGL demo to Ogre now but I’m having some difficulties. I know that I should use compute compositors and I have gotten a test compute shader running each frame as a “full screen post effect” compositor, but I’d want to ensure that my compute shaders are run before any rendering (or at least before I use the SSBO in a vertex shader). Is there a way to enforce my compute compositor to be run before rendering?
    9 replies
    Neomorebirus
    @Neomorebirus

    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++;
    3 replies
    Neonit
    @Neonit
    Is Caelum still a thing to use with Ogre 2? There is only ancient stuff to find about it.
    Joilnen
    @Joilnen
    How can set variable like OGRE_MEDIA_DIR to build this in a custom directory ?
    making only export OGRE_MEDIA_DIR=./Media in linux seems doesn't works
    2 replies
    Neonit
    @Neonit
    I'm trying to change a 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?
    Matías N. Goldberg
    @matiasgoldberg_twitter
    Call Item::setLocalAabb
    Neonit
    @Neonit
    That works, thank you. I think I understand why my approach didn't work now.
    albinomilk
    @Nirnroot5_twitter
    image.png
    I’ve got OGRE.sln on visual studio, and got these errors when building ‘ALL_BUILD’.
    How can this be fixed?
    SNiLD
    @SNiLD
    as the error implies, you're mixing debug and release libraries which is not allowed in C++
    Guillermo Ojea Quintana
    @sercero
    Thats a known issue
    tritonas00
    @tritonas00
    Hi. Is @paroj active here?
    Pavel Rojtberg
    @paroj
    occasionally
    tritonas00
    @tritonas00
    Ah, nice, just wanted to inform you that Rigs of Rods 2021.10 is out, so maybe you could update the snap package
    8 replies
    Neomorebirus
    @Neomorebirus

    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...

    • Only some instanced entities I have created lead to calling glDrawElementsInstanced (and uniform updates) each frame
    • When looking at the calls of glDrawElementsInstanced the instance count is always 1 instead of 1000
    • The material copies use world matrix which is given as an auto parameter. The world matrix is not updated according to the scene node for some reason. Manual parameters seem to update fine though.

    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.

    Pavel Rojtberg
    @paroj

    The material is copied from the same material for each instanced entity.

    you must use the same material

    Amlal El Mahrouss
    @amllx
    Hello everyone!
    I'm currently wondering if there is any bindings of imgui
    (any that are not deprecated)
    Neomorebirus
    @Neomorebirus

    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.

    Pavel Rojtberg
    @paroj

    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.

    Neonit
    @Neonit
    I am drawing two parallel lines (Ogre::OT_LINE_LIST) exactly at the same position. Obvisouly I'm getting z fighting now. Can I set one of the lines to be always drawn after the other so it is always in front of it?
    ogregamer
    @ogregamer:matrix.org
    [m]
    hiii
    3 replies
    i would require some help regarding ogre blender i cant seem to get it installed
    Neomorebirus
    @Neomorebirus

    Hello, I’m trying to update a SSBO from CPU to GPU but not getting it working (v. 1.12.9). I have a material file where I define my SSBO like this:

    shared_params someSSBO
    {
        shared_param_named data float [268800]
    }

    The SSBO is accessed inside a compute shader and a vertex shader like this:

    layout (std430, binding = 0) restrict buffer someSSBO
    {
        float data[268800];
    };

    Initially I set the values for the SSBO from a float vector:

    Ogre::GpuSharedParametersPtr ssbo = Ogre::GpuProgramManager::getSingleton().getSharedParameters("someSSBO");
    ssbo->setNamedConstant("data", buffer.data(), 268800);

    This works the first time, but I need to overwrite the SSBO later a few times. At later attempts the SSBO doesn’t get updated with the same commands. I have tried ssbo->_getHardwareBuffer()->writeData(0, 268800, buffer.data()); but this doesn’t work either. Does anyone have ideas?

    Pavel Rojtberg
    @paroj
    the first call is the preferred way and should work. Are the shared_prams referenced by normal params via addSharedParameters? Otherwise Ogre thinks they are unused and wont update the hardware buffer
    ALTernative
    @Amlal93
    Hello everyone; i've got some troubles getting Ogre up and running with Cocoa
    It still stays at the
    "Parsing scripts for resource group OgreInternal
    Finished parsing scripts for resource group OgreInternal
    Creating resources for group OgreInternal
    All done" I Think it might be a deadlock;
    and no window is being shown
    except for the subsystem dialog
    ALTernative
    @Amlal93
    Actually nevermind it just doesn't show at all
    Neomorebirus
    @Neomorebirus

    @paroj Sorry for the late reply and thanks for answering. I don’t use addSharedParameters explicitly, but I refer to the shared parameter SSBO in a material file like this:

    compute_program MyComputeProgram_GLSL glsl
    {
        source computeShaderCode.comp.glsl
        syntax glsl450
    
        default_params
        {
            shared_params_ref someSSBO
            shared_params_ref someUBO
        }
    }
    
    compute_program MyComputeProgram unified
    {
        delegate MyComputeProgram_GLSL
    }
    
    material MyComputeProgramMaterial
    {
        technique
        {
            pass
            {
                compute_program_ref MyComputeProgram
                {
                }
            }
        }
    }

    I guess this does addSharedParameters under the hood? My compute shader is also using an UBO shared parameter. The UBO gets correctly updated every frame with setNamedConstant.

    Pavel Rojtberg
    @paroj
    Neomorebirus
    @Neomorebirus

    Hello @paroj, I couldn’t trace the path you requested but if I call GpuSharedparameters::_upload directly like …

    Ogre::GpuSharedParametersPtr ssbo = Ogre::GpuProgramManager::getSingleton().getSharedParameters("someSSBO");
    ssbo->setNamedConstant("data", buffer.data(), 268800);
    ssbo->_upload();

    … I’m able to reach GL3PlusHardwareUniformBuffer::writeData -> GL3PlusHardwareBuffer::writeData -> OGRE_CHECK_GL_ERROR(glBufferData(mTarget, mSizeInBytes, pSource, getGLUsage(mUsage))); (line 136). A buffer update should be taking place in this case, but it won’t show.

    But anyway: Even if I won’t call _upload I get to this exception a bit later after trying to write to the SSBO: OgreAssertDbg(false, "Missing attribute!"); on line 22, OgreGLSLProgramCommon.cpp. The call stack is

    1. SceneManager::_issueRenderOp
    2. SceneManager::updateGpuProgramParameters
    3. GL3PlusRenderSystem::bindGpuProgramParameters
    4. GLSLProgramManager::getActiveProgram
    5. GLSLSeparableProgram::activate
    6. GLSLProgramCommon::extractLayoutQualifiers
    7. GLSLProgramCommon::getAttributeSemanticEnum

    The parameter type for GLSLProgramCommon::getAttributeSemanticEnum is the same as my shared parameters name “someSSBO” when the debugger stops. I assume this is not supposed to happen? I have quadruple checked that I’m writing the name correctly in the shaders, material files and code.

    Pavel Rojtberg
    @paroj

    But anyway: Even if I won’t call _upload I get to this exception a bit later after trying to write to the SSBO: OgreAssertDbg(false, "Missing attribute!"); on line 22

    I think you can safely ignore (comment out) this - at least in current master the results of this method are unused