Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    SNiLD
    @SNiLD
    here is simplified code:

    GLSL:

    uniform sampler2D colorTexture[4];

    C++:

    int numSamplers = 0;
    std::vector<int> colorSamplers(4);
    
    for (size_t i = 0; i < 4; ++i)
    {
        colorSamplers[i] = numSamplers++;
    }
    
    params->setNamedConstant("colorTexture", colorSamplers.data(), colorSamplers.size(), 1);
    that code only binds only the first colorTexture (at index 0), but there's nothing in index 1
    array size seems to be 4 according to NSight
    i also tried the params->setNamedConstant("colorTexture[0]", colorSamplers.at(0));, params->setNamedConstant("colorTexture[1]", colorSamplers.at(1));, etc. syntax
    which made no difference
    SNiLD
    @SNiLD
    (and actually instead of 4 i would like to use preprocessor define LAYER_COUNT, but judging from this line https://github.com/OGRECave/ogre/blob/master/RenderSystems/GLSupport/src/GLSL/OgreGLSLProgramManagerCommon.cpp#L124 i think using preprocessor defines is not resolved at this point yet?)
    Pavel Rojtberg
    @paroj

    (and actually instead of 4 i would like to use preprocessor define LAYER_COUNT, but judging from this line https://github.com/OGRECave/ogre/blob/master/RenderSystems/GLSupport/src/GLSL/OgreGLSLProgramManagerCommon.cpp#L124 i think using preprocessor defines is not resolved at this point yet?)

    this should work as the preprocessor runs in loadFromSource(). But you can verify by placing a breakpoint at the line you mentioned

    uniform sampler2D colorTexture[4];

    the sampler2D type might be a problem. Did you try with float arrays?

    SNiLD
    @SNiLD
    float arrays do not work correctly either (atleast for vertex shader)
    the first value is correct but second value is uninitialized
    oh actually it wasn't float array but vec2 array i tested
    so i changed the uvMul to be vec2 array and only the first vec2 is filled:
    Name, Location, Value, Type, Array Size, Array Stride, Matrix Stride, Is Row Major, Atomic Counter Buffer Index, Referenced By, 
    uvMul[0]    Default: 60    { 27.907, 32.4324, 25.5319, 25.5319 }    GL_FLOAT    4    -1    -1    0    -1    VS
    err actually uvMul is float array not vec2, i confused it with layerUV which is vec2
    SNiLD
    @SNiLD
    so yeah it seems float array does work (at least for vertex shader), i'll try fragment shader now and after that int array
    SNiLD
    @SNiLD
    float array and int array work in fragment shader so it's just sampler2D array
    SNiLD
    @SNiLD
    i have created bug report about this here: OGRECave/ogre#1352
    AlexanderKyron
    @AlexanderKyron
    Hi, I'm new to Ogre, I was wondering how to get up and running with the Java bindings?
    Pavel Rojtberg
    @paroj
    here is the bootstrap sample code as java:
    package ogrejava;
    
    import org.ogre.*;
    
    class MyInputListener extends InputListener {
        @Override
        public boolean keyPressed(KeyboardEvent evt) {
            if (evt.getKeysym().getSym() == 27) {
                Root.getSingleton().queueEndRendering();
            }
            return super.keyPressed(evt);
        }
    }
    
    public class Example {
        static {
            System.loadLibrary("OgreJNI");
        }
    
        public static void main(String[] args) {
            ApplicationContext ctx = new ApplicationContext("JNISample");
    
            ctx.initApp();
            ctx.addInputListener(new MyInputListener());
    
            SceneManager scnMgr = ctx.getRoot().createSceneManager();
            ShaderGenerator.getSingleton().addSceneManager(scnMgr);
    
            Light light = scnMgr.createLight("MainLight");
            SceneNode lightnode = scnMgr.getRootSceneNode().createChildSceneNode();
            lightnode.setPosition(0, 10, 15);
            lightnode.attachObject(light);
    
            Camera cam = scnMgr.createCamera("myCam");
            cam.setNearClipDistance(5);
            cam.setAutoAspectRatio(true);
    
            SceneNode camnode = scnMgr.getRootSceneNode().createChildSceneNode();
            camnode.attachObject(cam);
    
            CameraMan camman = new CameraMan(camnode);
            camman.setStyle(CameraStyle.CS_ORBIT);
            ctx.addInputListener(camman);
            camnode.setPosition(0, 0, 15);
            camnode.lookAt(new Vector3(0, 0, 0), Node.TransformSpace.TS_WORLD);
    
            Entity ent = scnMgr.createEntity("Sinbad.mesh");
            SceneNode node = scnMgr.getRootSceneNode().createChildSceneNode();
            node.attachObject(ent);
    
            Viewport vp = ctx.getRenderWindow().addViewport(cam);
            vp.setBackgroundColour(new ColourValue(0.3f, 0.3f, 0.3f));
    
            ctx.getRoot().startRendering();
            ctx.closeApp();
        }
    
    }
    you can find the *jar file and JNI lib in the Windows SDK on the homepage
    unfortunately I did not yet get to commit the code above into the repo
    AlexanderKyron
    @AlexanderKyron
    Thanks!
    Stanislas Dolcini
    @StanleySweet
    Hello any official Ogre member here?
    My name's Stan` I'm a dev from the FLOSS game 0 A.D. (https://play0ad.com/) but today I'm extending the invitation of the Godot engine to join us in our dev room at FoSDEM in 2020
    I tried to get in touch using the webmaster mail on your forums but didn't get a reply
    In case some of you are interested in giving a 30 min talk following those criteria
    Please register before the 14th of December (which is the extended deadline)
    On pentabarf
    Let me know if you have any questions
    Pavel Rojtberg
    @paroj
    Unfortunately I will be too busy in that time-frame to participate. I cannot speak for @matiasgoldberg_twitter, but for him that would be a transatlantic flight..
    Stanislas Dolcini
    @StanleySweet
    Alright, thanks for your time :) I'll wait for matias' reply
    Oh btw it's open to everyone, I just wanted to make sure I could get in touch with the people in the team :)
    @paroj btw we recently noticed we were using an old version of your GLSL preprocessor in our engine XD
    Matías N. Goldberg
    @matiasgoldberg_twitter
    Hi! Thanks for the invitation.
    December is a very busy month for me as Christmas and New Year makes my clients go crazy, and also Chinese New Year is in less 2 months, which makes it even more busy.
    Pavel Rojtberg
    @paroj
    @StanleySweet then you might be interested in this: OGRECave/ogre#614
    Stanislas Dolcini
    @StanleySweet
    Interesting thanks!
    @matiasgoldberg_twitter Actual event is February
    Stanislas Dolcini
    @StanleySweet
    If you are interested the only thing you'd need to do is to fill the form saying what you'd like to talk about in February
    Matías N. Goldberg
    @matiasgoldberg_twitter
    Oh d'oh. I'll have to read it with more time then. Thanks for the clarification
    Stanislas Dolcini
    @StanleySweet
    No problem :)
    I'm glad I managed to reach you eventually
    David Young-Chan Kay
    @DavidYKay
    Hi guys, sorry to bother -- I'm in the middle of integrating OGRE into a VR project and having some strange issues with the Tutorial_OpenVR example. I've written up a bug report: OGRECave/ogre-next#53. I'll update the ticket if/when I make any more progress. I would be very grateful for any guidance along the way. Thanks for a great piece of software.
    Matías N. Goldberg
    @matiasgoldberg_twitter
    Replied!
    Stanislas Dolcini
    @StanleySweet
    Ping me if you can come :)
    SNiLD
    @SNiLD
    @paroj I reported a bug that has been bugging me for a while and couldn't see direct repair for it: OGRECave/ogre#1359