Looks like there will be a LOT of merging work going on while this and resource manager separation will happen. Good thing Ogre uses a DSVC!!!

Yes, strings are going away, an integer replaces them (strings will be kept for usability, i.e. custom names, but they could be stripped away for Release ships, and don't have to be unique).ricardog wrote:Great ideas and congratulations! I have a few comments:
By that do you mean using integers instead of strings to identify and look for objects? That's gonna be a nice performance improvement indeed. While you're at it, I think some maps (such as the MovableObjectMap in SceneManager) could be changed to HashMap. That would also improve look up time a lot.dark_sylinc wrote:Implement unique ID system to replace unique name system.
I find OpenMP very limited. And I'm not worried about platform specific code because we'll just need the basics for those functions FrustumCulling & UpdateAllTransforms (I just need to be able to launch threads and use sync barriers). That's basically one solution for Windows, and another for almost everything else using POSIX threads. It's something I can code in one night as I'm experienced with it.ricardog wrote:Instead of implementing platform-specific code here, I think OpenMP might be a nice cross-platform solution. It doesn't require a separate package such as Boost or TBB and, unlike C++11 threads, it's available on older compilers.dark_sylinc wrote:Write a ThreadManager abstraction layer with a Windows implementation and thread FrustumCulling and UpdateAllTransforms.
In a moment of uncertainty, you must have looked in the mirror and thought to yourself, "Yeah...I am just that good."dark_sylinc wrote:I wouldn't leave 2.0 and/or 2.1 to students, unless they're really good, for example.
Touché. Tbh refer to the part "Didn't you say Ogre 2.0 was too big for GSoC?". The more I looked into it, the more 2.0 looked convincing, and I wasn't seeing myself in GSoC, then I said... why not? it was like a mental barrier or prejudgment I had.holocronweaver wrote:In a moment of uncertainty, you must have looked in the mirror and thought to yourself, "Yeah...I am just that good."dark_sylinc wrote:I wouldn't leave 2.0 and/or 2.1 to students, unless they're really good, for example.
In all seriousness though, I am glad to be working alongside you this summer.![]()
Could you clarify what changes, if any, you are planning to make to the RenderSystem class? I intend to work on the GL3+ render system in the 2.0 branch, but most of my core changes should be left to supporting the additional shaders (tessellation, geometry, compute).
Code: Select all
class StreamOut
{
void setMaterial( MaterialPtr mat );
virtual void render( RenderTarget *target ) = 0;
/*...*/
};
class D3D11StreamOut : public StreamOut { /*...*/ };
class GL3PlusStreamOut : public StreamOut { /*...*/ };
I had a similar experience, having to get over the preconception that GSoC was something only done by undergraduates with free summers (something I never had). Thankfully this summer will be the first lull in my entire college career, and I am grateful for it.dark_sylinc wrote:...I wasn't seeing myself in GSoC, then I said... why not? it was like a mental barrier or prejudgment I had.
I meant the latter, fixing common visual artifacts. I actually had not considered fixing the BSP scene manager itself, though you are likely right that no one would be willing to port such a mammoth. I will miss it though. CSG was my introduction to computer graphics and game programming. Doom, Duke Nukem and Unreal Tournament, anyone?I see BSP is marked as broken in your gsoc post. If it's the BSP demo as in "the demo", then the BSP manager won't work unless ported to 2.0; and I doubt someone will take the effort of doing it. BSP scene managers are really outdated.
If your intention is to fix it because "it has visual artifacts and any other situation could have them too", then I've got nothing to say
David already designed OpenGL 3+ with core functionality only - no fixed function pipeline. So...done!The idea is that 2.3 should be shader-only
Are you referring to using RTSS in these cases, or do you have something else in mind?...as long as we bundle something that removes the hassle of writting & managing shaders for trivial stuff (i.e. 2D guis, basic 3D materials).
That is an excellent idea! I always found that pattern to be one of the more tedious parts of graphics API. Sounds like states should be relatively easy to implement.Whether shader based or FF, at a higher level we will be managing 'states' to minimize redundant API calls; and the RS will be given the new states and make the changes, so all API calls get together in one place (or at least few).
Right now we're full of "glSetXX( Y ) doSomething() glSetXX( NULL )" sometimes being necessary, sometimes not so much, and same with D3D.
So close. Maybe GLES 4.0 will get us out of the woods.Something that IS relevant are texture buffers & constant buffers support...texture reads from vertex shaders in GLES 2.0 are optional (and most mobile gpus don't support it); therefore we'll have to support good ol' constant registers as well
I am glad this will be a priority because I plan to use it extensively in my personal projects.HW gamma correction should work and should never assume it's enabled unless explicitly told so (that last one probably doesn't work consistently across Ogre)
I have read your slides about a dozen times. Thank you for making them. I learned allot! Especially about cache management.The rest of the flow is in the slides.
Handling render streams sounds easy enough from the render system viewpoint.Now, what may be relevant for you is that the Compo Mgr. may be able of:
- Rendering a whole render_scene into stream out rather than a render target
- Encapsulate this stream out into a "Stream Out Container" and being able to use it in another pass, ie streamout_pass and output to a RenderTarget; so the RenderSystem takes the Stream Out Container and renders it.
- Have nodes used for GPGPU that take RenderTarges, Stream Out, Vertex Buffers or whatever is possible by the api as input and run a Compute shader on it (what will the output consist of, if any, I don't know yet, since gpgpu is too flexible. Probably GPGPU nodes will only enforce "execute me before node X" because node X uses something you know the GPGPU node touches)
You are correct about this being a feature of GL3. No doubt it could be handy. I am considering how I might use it for some of my samples.IIRC D3D11 & GL3 allow using a geometry shader deciding which texture the GPU should output to (i.e. selecting across 6 cube faces). It doesn't always work very fast depending on the operation, but it might be handy to have.
I had expected a reply mostly focused on Ogre 2.0, but am glad you decided to talk up to 2.3. You have given me many things to keep in mind while working on the GL3+ rendering system.To be honest, I feel we're far enough from 2.3 that I've been concentrated on the very low level details from 2.0 for this GSoC.
Agree, but I think it's a good idea to keep the FF code somewhere in the case in the future FF comes to be popular again (which is unlikely, but we never know). The problem is that if we want to be FF compatible we should keep the material related params which is in the Ogre core and not going to be used by default (assuming that 2.3 is going to be shader-only), so I don't know what's the best way to follow if finally we want to keep FF compatibility.* The idea is that 2.3 should be shader-only
Are you sure about this? I mean, maybe it's enough the way it works right now: you define if the texture unit must be gamma or linear (gamma corrected) and at loading time it's loaded being or not gamma correcte.* HW gamma. We support it in GL; the only change I pretend is that we can have .texture files where textures are flagged as "convert to linear space" and "leave in it's own space"
That's is going to be a tedious work* Something I often talk lightly is the new Compositor planned for 2.1
How about leaving things as they are now, but emitting a diagnostic whenever inconsistent gamma properties are detected for a texture?Xavyiy wrote:Are you sure about this? I mean, maybe it's enough the way it works right now: you define if the texture unit must be gamma or linear (gamma corrected) and at loading time it's loaded being or not gamma correcte.* HW gamma. We support it in GL; the only change I pretend is that we can have .texture files where textures are flagged as "convert to linear space" and "leave in it's own space"
Well there's a gigantic problem with that. See, if I have 2 Materials using the same texture, I have to declare the texture unit as using hwGamma explicitlyOwen wrote:How about leaving things as they are now, but emitting a diagnostic whenever inconsistent gamma properties are detected for a texture?Xavyiy wrote:Are you sure about this? I mean, maybe it's enough the way it works right now: you define if the texture unit must be gamma or linear (gamma corrected) and at loading time it's loaded being or not gamma correcte.* HW gamma. We support it in GL; the only change I pretend is that we can have .texture files where textures are flagged as "convert to linear space" and "leave in it's own space"
Hehe, we think very much alike. I haven't fully thought of the material settings, I'll probably want to leave them as they're now too; another alternative isXavyiy wrote:Agree, but I think it's a good idea to keep the FF code somewhere in the case in the future FF* The idea is that 2.3 should be shader-only
comes to be popular again (which is unlikely, but we never know). The problem is that if we want to be FF compatible we should keep the material related
params which is in the Ogre core and not going to be used by default (assuming that 2.3 is going to be shader-only), so I don't know what's the best way to
follow if finally we want to keep FF compatibility.
I remembered something about shadow map rendering, I ended up realizing the best solution to the problem is to let the user create a compositor node that says what to render into the shadow map (the main question is what visibility flags and what RQs to use, and the user can know the answer to those) and use that node for shadow maps.I like the RQ system you're propossing, and also you're considering even at this early stage the implication of shadow maps, let's see how this
develops when the time comes!
Code: Select all
myShadowNode
{
technique pssm
num_shadow_maps 6
num_splits 3
num_lights_with_splits 1
shadow_map 0 PF_FLOAT_16 light 0 split 0 //Render light 0 (assuming directional) in split 0
shadow_map 1 PF_FLOAT_16 light 0 split 1 //Render light 0 (assuming directional) in split 1
shadow_map 2 PF_FLOAT_16 light 0 split 2 //Render light 0 (assuming directional) in split 2
shadow_map 3 PF_FLOAT_16 light 1 //Render 2nd closest light in the 3rd shadow map (can be directional, point, spot)
shadow_map 4 PF_FLOAT_16 light 2 //Render 3rd closest light in the 4th shadow map
shadow_map 5 PF_FLOAT_16 light 3 //Render 4th closest light in the 5th shadow map
//Render shadow maps #0, 1, 2, 3, and 5
shadow_map 0 1 2 3 5
{
render_scene
{
visibility_flags 0xff00ff00
rq_first 0
rq_last max //Special value implying maximum
}
}
//Render missing shadow map #4 with different settings
shadow_map 4
{
render_scene
{
visibility_flags 0x0000000f
rq_first 2
rq_last 3
}
}
}
Yeah, I had the same frustration. It had to do with the order of Compositor and what RQs they were using IIRC.Btw, the current render_pass first_render_queue and last_render_queue attributes are buggy somehow (at least with complex compositor chains), in my engine I've had to use viewport visibility flags instead to render group of objects since first_render_queue and last_render_queue didn't do their job. I had done
some debugging but nothing obvious so I finally left it.
I have no idea.Btw, what do you think about the future of Ogre::RenderObjectListener::notifyRenderSingleObject ? I'm saying it because the core of my engine relies on being able to change the pass texture units and constants depending of the object (so with one single material you are able to render different objects using different textures and/or parameters), something similar to Ogre::Renderable::setCustomParameter but more high level.
That convinced me much more, pixel file format specification and cube/array textures definition. It could also work to define animated textures (ogre already has this feature, dunno how much it's used but in Hydrax, for example, I use it for the water caustics animation).So, .texture files remove the problem, and you don't have to define it if you don't want to. .texture files are also useful for other stuff, for example
enforcing a particular pixel format (i.e. PF_L8) without having to do it each time in the material.If you don't define the texture in a .texture file, it's loaded with defaults (or what the material texture unit definition says).You don't have to deal with the complexity of another .texture file if you don't want to, but if you're using an WYSIWYG editor (your case Xavi!) it's really useful, because you get to store custom texture parameters in a centralized file.
It's also a lot easier to create cubemaps, 3D textures and 2D array textures from separate files, because you can define a an arbitrary texture name i.e.
"MyCubeMap" and construct if from 6 different files or "MyTextureArray" and just use that texture as input to the material.
I would leave them as they're now, it makes sense since you can have access to them in shaders via auto params (ambient color, blah blah) and in the case it's needed in the future, the FF system can relie on these generic params.Hehe, we think very much alike. I haven't fully thought of the material settings, I'll probably want to leave them as they're now too; another alternative is
to create custom params and assign them automatic bindings (sounds familiar?)
Looks like a very good idea. Simple and the user has a total control on it. =)That is a very flexible & easy way of rendering shadow maps, IMHO. Of course there's validation: If a node has 2 lights with splits and 3 splits per light, then you need to use all 6 splits, if you define 6 shadow maps, you have to specify render_scene to all of them.
And with a bit of tweaking we can use MRTs and reflective shadow maps can be created, which are useful for Global Illumination.
Glad to know I'm not the only affected. Yes, it had to do with the comp order and min/max RQs, anyway since this part will be redesigned it's not worth spending time fixing it for 1.9.Yeah, I had the same frustration. It had to do with the order of Compositor and what RQs they were using IIRC.
Well, the idea is avoid creating so many materials but I've taken the concept further: in my engine's materials, you have 3 type of "custom parameters": spatial_custom_param, node and scene. (appart from constant params and auto_params)I have no idea.
Using a non-const renderable is dangerous (thread safety) so it's probably going const. I take your point is to avoid creating so many materials when they all share everything but the texture?
That listener may affect how Ogre wants to batch everything. But honestly I have no idea yet.
Search the forum, we had a lot of discussions how to get rid of dependencies.smisra wrote:Well am a novice user for Ogra. What i can see is Ogre has some SSE libraries, shared pointer etc. So as it will move to 2.0, why not use the functionality of Boost library more so as to simplify the tasks.I am not sure regarding the amount of work, but just a suggesting.
The whole point of efficientVectorRemove is to avoid using std::vector::erase. Erase() will preserve the order of the container when removing an element in the middle hence takes O(N); efficientVectorRemove takes O(1) but doesn't preserve such order.Klaim wrote: 1. could have the efficient remove function have been implemented using the remove-erase idiom? It looks like it's doing the same thing without the index manipulations;
std::vector<SceneNode&> is not legal, and writing "&" each time on the input parameter to compare against the vector's content (or push into it) makes it worse/harder to read.Klaim wrote: 2. suggestion: use non-const references as function attributes instead of pointers if it is not valid to provide nullptr;
Ah yes I see.dark_sylinc wrote: The whole point of efficientVectorRemove is to avoid using std::vector::erase. Erase() will preserve the order of the container when removing an element in the middle hence takes O(N); efficientVectorRemove takes O(1) but doesn't preserve such order.
Obviously I was not suggesting thisdark_sylinc wrote: std::vector<SceneNode&> is not legal,
I disagree [...], but I guess that's really a minor detail, don't bother.and writing "&" each time on the input parameter to compare against the vector's content (or push into it) makes it worse/harder to read.
Both I think. First upfront before you start so that you know where to actually optimize (where you will get the most gain by the fewest amount of work) and then afterwards to check whether your assumptions about the optimization held true and you actually gained a boost.Klaim wrote:Shouldn't profiling be done when you finish the most important changes?
This technique looks very similar to the VectorSet class used here: https://bitbucket.org/sinbad/ogre/src/c ... v1-9#cl-89spacegaier wrote:Just for reference: Mathias posted about about some upcoming changes on his blog:
Ogre 2.0: O(1) insertion, removal and contiguous memory iteration
I know it is set by default, you have to disable it with /GS-masterfalcon wrote:It may or may not currently compile. There are many huge changes so performance checks after each checkin aren't realistic. As for the current state, check the mercurial log and this forum.
Unless it is added by default, /GS is not added explicitly by Ogre.