Pixel Perfect Posted May 29, 2011 Share Posted May 29, 2011 Up until very recently I have been doing all my development in version 2.31 with C++. Wanting to take advantage of some of the later features I recently upgraded the engine to 2.42 modifying my code where necessary. I also at this point decided to ditch the original (open-source) framewerk and recode the engine to use the embedded framework. On the whole this has been very successful, however I now notice that a graphical effect I really liked in 2.31 no longer seems to manifest itself and I'm really not sure why this is. It appears in 2.31 when you use HDR combined with Bloom and its a kind of light bleeding or leakage that you get round objects. This looks really natural when walking through brightly lit trees and I think is a really impressive effect. However, this does not appear when using 2.42 with framework and as I can see no differences between the Bloom and HDR shaders I'm at a loss as to why this should be. If anybody can reveal any insight into this I'd be grateful. This demonstrates the effect in 2.31 I'm talking about, it's a lot more noticable in motion but this still picture still shows it: This is the same scene in 2.31 with HDR switched off: This is the same scene in 2.42 with HDR: This is the same scene in 2.42 with HDR switched off: Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
VeTaL Posted May 29, 2011 Share Posted May 29, 2011 Have no idea in shaders, but maybe you can try to use old shaders pak? Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Pixel Perfect Posted May 29, 2011 Author Share Posted May 29, 2011 Thanks Vetal, I was considering doing that, simply replacing the 2.42 shader pack with the 2.31 one (if it's indeed possible to do that) however I have since discovered something else. If I use the 2.42 engine with my original 2.31 build which still uses the framewerk then I get the same effect. So this seems to be telling me that is framewerk itself as opposed to framework that is producing this! Maybe a difference in the use / blending of buffers or something. This now leaves me in a bit of a dilemma. I really like this effect so do I go back to framewerk and abandon framework Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
VeTaL Posted May 30, 2011 Share Posted May 30, 2011 Well, try to add this to bugtracker. (at least, link to this thread) If Josh would fix all last bugs and release 2.45 or 2.5 - that would be just perfect Quote Working on LeaFAQ Link to comment Share on other sites More sharing options...
Pixel Perfect Posted May 30, 2011 Author Share Posted May 30, 2011 Well I'm not sure it's a bug ... just different. I can see the HDR working in 2.42 it just doesn't have this light leakage effect. As the shader code seems to be identical between the versions I can only assume its a difference in what's being fed into them. Framewerk produces the effect, framework doesn't. That's my findings so far anyway, I maybe mistaken and there is some other factor contributing to this which I'm currently unaware of. I guess only Josh really knows what's going on behind the scenes and he's not commented on this so far. As it's an asthetic thing some people may prefer it without this effect. I'm not currently using Lua so swapping back to framewerk isn't an issue for me and has some advantages as I've added some additional functions, that framework doesn't have, to give me access to the rendering buffers. At least I'm assuming I cannot use framewerk easily with Lua as I guess the Lua scripts are using the framework command set. Not having looked into it I'm not sure where Lua gets its engine definitions from. Maybe I could wrap the framewerk functions there so the same commands point to their framewerk equivalents. Either way, at some point I suspect I probably need my own implementation of Lua to expose my C++ classes so I can script my AI using Lua. If Josh would fix all last bugs and release 2.45 or 2.5 - that would be just perfect That would be just perfect, although I do believe Josh has been doing a great job of keeping on top of the bugs in the current version which must be a huge distraction when trying to design and code a new engine! Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted May 30, 2011 Share Posted May 30, 2011 ... I now notice that a graphical effect I really liked in 2.31 no longer seems to manifest itself and I'm really not sure why this is. i know just what you mean... this is exactly what scares me with every update... we lost the beautiful foam and water waves way back when... and never got em back... hey Pix, quick question... which effects that you wanted to employ made you decide to go to 2.42 and itch the framwerk... --Mike Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted May 30, 2011 Author Share Posted May 30, 2011 Hi Mike. Yeah, we have lost some nice things along the way. The terrain erosion tools in Sandbox come to mind too! The move to 2.42 from 2.31 was really to gain the advantage of Vegetation Collision and the move to framework to get the ability to play with the Saturation/Brightness/Contrast settings. It also gave me the chance to load Lua scripted objects for the first time and play around with those. Klepto's DayNight package is really nice (might have to convert that to C++). As I've not really needed to use Lua before I never really looked at how it's been implemented so I'm not sure if I can still do so whilst using framewerk or not. I was led to believe a while back that this wasn't possible, but without looking into it or someone knowledgeable telling me if I can or cannot then I'll keep an open mind on this. I don't know what if anything is embedded in the engine to facilitate this and if it's inherently dependant on framework. Although I'm not dependant on Lua scripted objects in any way it has been nice to have the ability to load them whilst using framework. The big issue I've always had with the existing implementation of Lua is it doesn't support the exporting of C++ class methods to Lua making it much less powerful than it otherwise would have been. That's why I have always envisaged I'd have to add my own implementation at some point in the future so I can script my AI in Lua (external from the engine). Version 3 will take care of this of course. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted May 30, 2011 Share Posted May 30, 2011 thx for the reply Pix... me too with never having to use lua before... i'm mainly looking at 2.42 for any apparent improvements in performance... so far, in BlitzMax, i haven't been able to get water to paint properly... i also found the framewerk very convenient... again, thx, and good luck with your 'stuff'... --Mike Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted May 31, 2011 Author Share Posted May 31, 2011 Thanks Red, good luck with your development too. I know the water one has been a real headache for you for some time. I'm sure someone with good shader knowledge could help move that on for you. I feel hampered at times through not having sufficient shader knowledge to design or modify them but there are only so many hours in a day for learning new tricks! I hate having to compromise but for just now I think I'm going to stick with 2.42 and framewerk as I have everything working nicely with that and I really don't want to lose this effect. Lua will have to go back onto the back burner for just now. I will also unfortunately lose the Saturation/Brightness/Contrast settings too which is a real shame. But life often is a series of compromises. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Pixel Perfect Posted May 31, 2011 Author Share Posted May 31, 2011 I believe I've got closer to identifying the issue. It appears the effect is caused by a combination of HDR and FarDOF. But the FarDOF settings seem to be behaving differently between framewerk and framework. I need to investigate some more before I can draw any firm conclusions but I have got the effect partially working now in framework, just nowhere near as strong as it is in framewerk. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Richard Simpson Posted June 1, 2011 Share Posted June 1, 2011 I think we are getting the decent water back in LE3 aren't we? I miss the erosion tools for terrain also! If I ever try and make a terrain now, it looks all smooth and rubbish! I always liked the look of STRANDED in 2.31... It reminds me of "battlefield: bad company 2" how everything seems saturated, and it looks great. Quote Intel core 2 quad 6600 | Nvidia Geforce GTX460 1GB | 2GB DDR2 Ram | Windows 7. Google Sketchup | Photoshop | Blender | UU3D | Leadwerks Engine 2.4 Link to comment Share on other sites More sharing options...
Pixel Perfect Posted June 1, 2011 Author Share Posted June 1, 2011 I think we are getting the decent water back in LE3 aren't we? I miss the erosion tools for terrain also! If I ever try and make a terrain now, it looks all smooth and rubbish! Yes, I hoping the water in LE3 will be better than anything we have seen so far. I still have all the previous versions of Leadwerks from its first release so I'm able to go back and use Sandbox and the terrain erosion tools and just export the height map. They really were useful tools and I never understood why they were removed. I always liked the look of STRANDED in 2.31... It reminds me of "battlefield: bad company 2" how everything seems saturated, and it looks great. Thanks Richard, and that's very much the reason why I'm not keen to let that go! All of this is distracting me big time from continuing with coding for Kingdom Of Soul but worth spending some time on I think to try and understand what's producing this effect and why I can seem to replicate it exactly using framework. Moving to 2.42 has been successful so I do at least have everything that comes with that which isn't dependant on framework. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted June 2, 2011 Share Posted June 2, 2011 They really were useful tools and I never understood why they were removed. yup... me too left wondering... --Mike Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted June 3, 2011 Author Share Posted June 3, 2011 Having done a lot more comparisons between C++ and framework and C++ and framewerk I now understand why I am seeing the differences. Quite simply framewerk has a bug where turning on HDR causes the DOF to be applied accross all ranges seemingly ignoring the DOF Range setting. As I had the DOF strength setting fairly low it was not initially obvious what was happening. So framework works correctly, framewerk does not and the effect I like is effectivly an artifact of a bug, not exactly what I wanted to find but at least I now know. The issue appears to be in the following bit of code: void Renderer::SetHDR( bool mode ) { if( GetShaderModel()>=4 ) // SM4 is required! if( hdrenabled!=mode ) { hdrenabled=mode; if( 0==hdrformat ) { // Create a test texture to see if format is supported TTexture tex = CreateTexture(64,64,TEXTURE_RG11B10); if( tex ) { hdrformat=TEXTURE_RG11B10; FreeTexture( tex ); } else hdrformat=TEXTURE_RGBA16; } FreeBuffers(); } } The TTexture tex is created successfully and as a result the hdrformat is set to RG11B10. If I hard code this to RGBA16 then the hdr and DOF works correctly. Maybe you could comment on this Josh as I'm not sure what you were intending here. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Mumbles Posted June 3, 2011 Share Posted June 3, 2011 For me, that could be a helpful find... Quote LE Version: 2.50 (Eventually) Link to comment Share on other sites More sharing options...
Pixel Perfect Posted June 4, 2011 Author Share Posted June 4, 2011 For me, that could be a helpful find... Glad to hear, and for anyone else using framewerk hopefully. I've decided to stick with framewerk as I've never liked the fact that framework is enbedded in the DLL with no way of altering it or extending it. I'm going to test this out with several other nVidea cards and also an ATI and if the effect (bug) is consistent then I'll see if I can make this effect switchable by adding my own procedure in renderer.cpp. Of course this means goodbye yet again to Leadwerks implementation of Lua as I'll need to implement my own Lua (or other scripting language). But that was always on the cards as I need to expose my C++ Classes to the scripting language which the current implementation of Lua doesn't support. Looks like I might be porting Klepto2's daynight system to C++ after all. Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
Pixel Perfect Posted June 4, 2011 Author Share Posted June 4, 2011 I decided to take a look at the BlitzMax framework code as I'd forgotten this was still being published (as the module can't be built because of the name being reserved or something) and found that the code which sets the hdrformat to TEXTURE_RG11B10 had been commented out confirming what I've found. An additional bonus was the fact that, as this is clearly still being maintained unlike the C++ framewerk, it contains the code for setting the Saturation/Contrast/Brightness which means I can now update the C++ framewerk to support Saturation/Contrast/Brightness too ... cool! Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ Link to comment Share on other sites More sharing options...
AggrorJorn Posted June 5, 2011 Share Posted June 5, 2011 Oftopic: great images Pixel. Quote Link to comment Share on other sites More sharing options...
Pixel Perfect Posted June 5, 2011 Author Share Posted June 5, 2011 Thanks Aggror ... your critique is always appreciated Quote Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++ 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.