[SOLVED] Clipplanes in opengl

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!

Re: [SOLVED] Clipplanes in opengl

Postby CuteAlien » Thu Mar 22, 2012 9:36 pm

@Sinsemilla: irr::core::string::empty is only available in svn trunk, that was not yet in Irrlicht 1.7. So I guess you will have to install svn trunk for that (often the better choice anyway).
IRC: #irrlicht on irc.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5364
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: [SOLVED] Clipplanes in opengl

Postby Sinsemilla » Thu Mar 22, 2012 11:35 pm

@CuteAlien: Thanks for the advice, by using the trunk the irr::core::string::empty errors are gone. :D

Unfortunately i still need a little bit help. The are 3 errors left which i don't really know what to do about. The compiler tells me that basically that the assingment operator for the class map can't be used. This happens in void CPostProcessManager::SwapAuxBuffers(), on this line of code:

cpp Code: Select all
RenderTargetMap["auxIn"] = RenderTargetMap["auxOut"];
 


||=== RMLWars, Release ===|
/home/omikronn/Projects/irrlicht/include/irrMap.h||In member function ‘irr::core::map<const irr::core::string<char>, irr::video::ITexture*>::AccessClass& irr::core::map<const irr::core::string<char>, irr::video::ITexture*>::AccessClass::operator=(const irr::core::map<const irr::core::string<char>, irr::video::ITexture*>::AccessClass&)’:|
/home/omikronn/Projects/irrlicht/include/irrMap.h|631|error: non-static reference member ‘irr::core::map<const irr::core::string<char>, irr::video::ITexture*>& irr::core::map<const irr::core::string<char>, irr::video::ITexture*>::AccessClass::Tree’, can’t use default assignment operator|
/home/omikronn/Projects/irrlicht/include/irrMap.h|631|error: non-static reference member ‘const irr::core::string<char>& irr::core::map<const irr::core::string<char>, irr::video::ITexture*>::AccessClass::Key’, can’t use default assignment operator|
/home/omikronn/Projects/RMLWars/effects/PostProcessManager.cpp||In member function ‘void CPostProcessManager::SwapAuxBuffers()’:|
/home/omikronn/Projects/RMLWars/effects/PostProcessManager.cpp|53|note: synthesized method ‘irr::core::map<const irr::core::string<char>, irr::video::ITexture*>::AccessClass& irr::core::map<const irr::core::string<char>, irr::video::ITexture*>::AccessClass::operator=(const irr::core::map<const irr::core::string<char>, irr::video::ITexture*>::AccessClass&)’ first required here |
||=== Build finished: 3 errors, 0 warnings ===|
||=== Build finished: 3 errors, 0 warnings ===|

Anyway, many thanks in advance.
Sinsemilla
 
Posts: 20
Joined: Mon Jan 09, 2012 5:07 pm

Re: [SOLVED] Clipplanes in opengl

Postby Sinsemilla » Fri Mar 23, 2012 1:39 am

I could solve the problem by rewriting the line in SwapAuxBuffers :D.

In the meantime i compiled the little demo code. But somehow i have a weird water effect where the normalmap seem to shine through the surface looking like this:

Image

Also the distortion seems to be too strong during the underwater view:
Image
Image

I compiled the example on Linux, so it all about GLSL :wink: .
Sinsemilla
 
Posts: 20
Joined: Mon Jan 09, 2012 5:07 pm

Re: [SOLVED] Clipplanes in opengl

Postby Sinsemilla » Fri Mar 23, 2012 1:48 am

And btw: as you can see the sky has changed. I am using a skydome. However, i first compiled the example with a skybox, which had the same effect as result. I could be also important to say that the windows example executed through wine is looking identical to the first screenshots posted in this thread (therefore it is looking as expected since the skybox error is visible):

Image
Sinsemilla
 
Posts: 20
Joined: Mon Jan 09, 2012 5:07 pm

Re: [SOLVED] Clipplanes in opengl

Postby Sinsemilla » Fri Mar 23, 2012 7:41 pm

I have a little guess: The only thing which is really different is the revision of the svn trunk, mine is probably never. @tbw which Rev. did you use for the example? i used rev. 4113.
Sinsemilla
 
Posts: 20
Joined: Mon Jan 09, 2012 5:07 pm

Re: [SOLVED] Clipplanes in opengl

Postby Sinsemilla » Sat Mar 24, 2012 9:47 pm

After a little bit of trying i found out that the changes from rev 4105 to 4106 are causing the weird effect. So using rev 4105 is fine for me :)
Sinsemilla
 
Posts: 20
Joined: Mon Jan 09, 2012 5:07 pm

Re: [SOLVED] Clipplanes in opengl

Postby CuteAlien » Sun Mar 25, 2012 9:36 am

I just checked the part that map's can't do the "mymap["foo"] = mymap["bar"]" thing. The reason is that core::map returns some AccessClass instead of just a reference to T. But I don't think that was ever different - so your code probably should use std::map instead (and maybe some day someone finds motiviation to dig into core::map and figure out if there is any reason for that...).
IRC: #irrlicht on irc.freenode.net
My patches&stuff: http://www.michaelzeilfelder.de/irrlicht.htm
Games with Irrlicht: http://www.irrgheist.com/
News: http://www.reddit.com/r/irrlicht/
User avatar
CuteAlien
Admin
 
Posts: 5364
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany

Re: [SOLVED] Clipplanes in opengl

Postby Nadro » Sun Mar 25, 2012 12:54 pm

Hi, in a rev4106 we added support for an int uniforms and now in Your shader callback, You must bind a textures by int instead of float parameter, so eg:
cpp Code: Select all
int Tex0 = 0;
dervices->setPixelShaderConstant("tex0", &Tex0, 1)0;
int Tex2 = 2;
dervices->setPixelShaderConstant("tex2", &Tex2, 1);

I think that we should add some note about this change (and improve example no. 10, because currently it usage wrong, floats type method). Bind a texture by a float interface caused problems on some machines (texture wasn't bind properly, but only in some cases, so was problematic for debugging and thats why I removed support for textures by a float interface and left only int interface for a textures).

BTW. In an OpenGL shader callback we use extGlGetUniformLocation call for an each setPixelShaderConstant call and this is serious fault (It can cause fps drop in an applications with many setPixelShaderConstant calls). In my opinion we should add a cache similar for this for vertex attribute locations in FVF stuff. For shaders, cache will be even simpler.
NBK Game Studio - Official Site:
http://www.nbkgamestudio.pl/
Nadro
 
Posts: 1000
Joined: Sun Feb 19, 2006 9:08 am
Location: Warsaw, Poland

Re: [SOLVED] Clipplanes in opengl

Postby tbw » Sun Mar 25, 2012 7:19 pm

I used a rev earlier than 4106, because the new setPixelShaderConstant with int uniforms Nadro mentioned was not available.
I didn't notice the change though I look into this part of the code quite often.
@Sinsemilla: In which way did you change the swapAuxBuffer code (I want to change the code and upload a new version for the xml postproc framework)
I thing changing SwapAuxBuffers from
cpp Code: Select all
void CPostProcessManager::SwapAuxBuffers()
{
        // swap the in and out buffers
        video::ITexture* tmp = RenderTargetMap["auxIn"];
        RenderTargetMap["auxIn"] = RenderTargetMap["auxOut"];
        RenderTargetMap["auxOut"] = tmp;
}

to
cpp Code: Select all
void CPostProcessManager::SwapAuxBuffers()
{
        // swap the in and out buffers
        video::ITexture* auxIn = RenderTargetMap["auxIn"];
        video::ITexture* auxOut = RenderTargetMap["auxOut"];
        RenderTargetMap["auxIn"] = auxOut;
        RenderTargetMap["auxOut"] = auxIn;
}

should work
Also the water is nearly finished and I will upload it in the next days in the code snippets section.
Thanx in advance!
tbw
 
Posts: 58
Joined: Sat Jan 15, 2011 9:51 am
Location: Germany

Re: [SOLVED] Clipplanes in opengl

Postby Sinsemilla » Mon Mar 26, 2012 3:44 pm

@tbw: Looks like this is the most obvious change possible. :D My code in SwapAuxBuffers looks exactly the same, this will definitively work. Even the variable name is identical :wink:
Sinsemilla
 
Posts: 20
Joined: Mon Jan 09, 2012 5:07 pm

Previous

Return to Advanced Help

Who is online

Users browsing this forum: No registered users and 0 guests