Rick Posted May 6, 2014 Share Posted May 6, 2014 I like the idea of an effect collection. How do you see it working though? How do you know what effect you're adding? We would need some kind of identifier on each effect. This requires knowing all effects. I think this works for the base stuff we know today, but would have to be updated when new effects come out. How do you see this working? Update RenderFramework with delete and clear effects. My C++ is a little rusty but I think I have the idea. Just doing this in notepadd++ so not checking for compiling. class RenderFramework { private: World* bgWorld; World* fgWorld; Buffer* bgBuffer; Buffer* fgBuffer; list<IEffect*> effects; public: void RenderFramework() { // create the worlds and buffers } IEffect* AddEffect(IEffect* effect) { effect->SetBGWorld(bgWorld); // etc. set the effects worlds/buffers // add this effect effects.push_back(effect); } void RemoveEffect(IEffect* effect) { list<IEffect*>::iterator iter; for(iter = effects.begin(); iter != effects.end(); ++iter) { if(effect == (*iter)) { // store off our effect so we can delete it IEffect* e = (*iter); // remove this entry in the list effects.erase(iter); // delete our effect delete e; return; } } } void ClearAllEffects() { list<IEffect*>::iterator iter; for(iter = effects.begin(); iter != effects.end(); ++iter) { delete (*iter); } effects.clear(); } void Update() { // loop over effects and call Update() } void Render() { // loop over effects and call Render() } }; 1 Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted May 6, 2014 Share Posted May 6, 2014 Well it depends a bit on how shaders work (and my knowledge on them is very low). Lets say shadmar has created 3 post effects that need to be in a certain order, he can make a new class deriving from EffectCollection and add his effects in the order they are supposed to work. Although you still have the freedom, you also have a container of effects that belong together. But this is something shadmar needs to shed some light on. I have no idea if this way would be ideal. Quote Link to comment Share on other sites More sharing options...
Rick Posted May 6, 2014 Share Posted May 6, 2014 Ah ok, so the idea being the creator of the shaders can make a collection class that combines effects and adds them in the "right" order and then users can make an instance of this class and they get a predefined look. I like that idea as it still allows for users to create their own order of effects or just use a predefined order via a collection class predefined by someone. They are just like helper classes to get a predefined look. I like that as a helper class. I don't think getting the order of something is overly complicated, but this can help for sure. Quote Link to comment Share on other sites More sharing options...
Josh Posted May 6, 2014 Share Posted May 6, 2014 The framework class in LE2 was a horrible hack when I realized no one knew how to use the old post-effects system. The modular post-effects system in 3.1 replaces that. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted May 6, 2014 Share Posted May 6, 2014 @Josh I think the main question here is the requirement for multiple worlds/buffers. Shadmar is saying that it's possibly more efficient to have multiple worlds/buffers and the current 3.1 system seems to use just 1? My understanding is that we can use Lua scripts as a post-processor (which allows us to create more worlds/buffers if we need) which is great, but that's only Lua and not C++. The C++ crowd could still use something that helps with this. What we are proposing here seems a lot like Lua post processor scripts but just C++ classes for the the C++ people. Same idea but for C++. Quote Link to comment Share on other sites More sharing options...
shadmar Posted May 6, 2014 Author Share Posted May 6, 2014 @Josh, What would be the preferred way to do this in C++? Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
AggrorJorn Posted May 7, 2014 Share Posted May 7, 2014 Unless a good reason (for instance an un-announced feature) is given, I would suggest we go for it. Personally I think the whole community can benefit from these opensource projects. Quote Link to comment Share on other sites More sharing options...
shadmar Posted May 7, 2014 Author Share Posted May 7, 2014 Ok I suggest we use a github repo, has free issue tracker, and wiki, storage is also free for open source projects. If anyone needs a quick intro/tutorial in using github and git (command line) I can do that. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
AggrorJorn Posted May 7, 2014 Share Posted May 7, 2014 I have created a repo here https://github.com/Aggror/LeadwerksRenderFramework unless someone wants it on their account. Rick and Shadmar I believe I have your email addresses and will add you as admins. I have added shadmar but I can't find an account for Rick. @Rick: do you have a github account? if not, can you make one? Quote Link to comment Share on other sites More sharing options...
Josh Posted May 7, 2014 Share Posted May 7, 2014 @Josh I think the main question here is the requirement for multiple worlds/buffers. Shadmar is saying that it's possibly more efficient to have multiple worlds/buffers and the current 3.1 system seems to use just 1? The whole multiple world thing was a bad hack. Why would you need this? @Josh I think the main question here is the requirement for multiple worlds/buffers. Shadmar is saying that it's possibly more efficient to have multiple worlds/buffers and the current 3.1 system seems to use just 1? My understanding is that we can use Lua scripts as a post-processor (which allows us to create more worlds/buffers if we need) which is great, but that's only Lua and not C++. The C++ crowd could still use something that helps with this. What we are proposing here seems a lot like Lua post processor scripts but just C++ classes for the the C++ people. Same idea but for C++. The advantage of Lua script effects is that it can just be inserted into any program without recompiling, including C++ programs. These scripts are very simplistic. Usually all they would do is bind some textures and manage buffers, as my example bloom script does. I was really hoping people would focus more on making games instead of trying to re-engineer the renderer. The current system is designed so that if one person makes a plugin effect, everyone benefits. If you branch the renderer, you are isolating yourself from a lot of content you could be using. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Rick Posted May 7, 2014 Share Posted May 7, 2014 What we are talking about sound the same, but one is Lua and the other is C++. Really the only difference I see in this design is the ability to pass parameters to the effect so it can be passed to the shader to allow for even more customization within each effect. Also, perhaps the ability to alter the effect at run-time by the means of these variables? Shadmar could probably list other limitations he's seeing for the reason he asked for this. Quote Link to comment Share on other sites More sharing options...
Josh Posted May 7, 2014 Share Posted May 7, 2014 Yeah, that's going to be a limitation for a little while, but it's best to do these things one step at a time. First we get the Workshop launched, make sure the effects system works as intended, then add some more customizable controls. It will come. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
shadmar Posted May 7, 2014 Author Share Posted May 7, 2014 I thought of worlds as rendertargets, if you want to do refraction. If you only use one world : Render world without refracted mesh Pass buffer to refract shader Render world again with everything. <-- wouldn't this be a bit overkill, if you could render this alone using 2 worlds instead of most of it again? I really like the current lua effects system and certainly don't want to branch the renderer i any form. So if you think this would be a waste of time, then I'm in no hurry Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
AggrorJorn Posted May 7, 2014 Share Posted May 7, 2014 At any rate, it might be something that we as community can help with. Although other frameworks might be a nice idea as well. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.