Thx @ criss and devsh for this patch (got applied with minor adaptions).
New functions are about functions using new direct state access functions from GL 4.5
And array textures.
Not yet used internally in the engine (but possible to access it with some hacks from apps, we probably should make the extension handler public at some point).
Also now using glActiveTexture as default instead of glActiveTextureARB.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5818 dfc29bdd-3216-0410-991c-e03cc46cb475
Deprecate PolygonOffsetFactor and PolygonOffsetDirection in SMaterial.
Replace it by PolygonOffsetDepthBias and PolygonOffsetSlopeScale.
Old values still work for now (as well as they did), but will be removed after Irrlicht 1.9.
The old implementation was based a lot on the way Direct3D8 had worked.
- We only had values -1 and 1 for the slope bias before, but sometimes other values are necessary.
- An int value for PolygonOffsetFactor couldn't worked for Direct3D9 which (unlike D3D8) uses a value range of -1 to 1.
Thx @ Criss and devsh for implementing some code which showed that different slope scaling is sometimes needed.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5817 dfc29bdd-3216-0410-991c-e03cc46cb475
(was still unix-style as I just copied this header from khronos).
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5816 dfc29bdd-3216-0410-991c-e03cc46cb475
Note: Khronos made glext.h now depend on a new file KHR/khrplatform.h
The idea seems to be that some common types can be shared with other gl headers (for gles versions).
But I run into some problem with that as it was included with <> instead of "" so Visual Studio wouldn't find
it without adding include paths to all projects for new KHR folder. Didn't want that (can't test that for example on iOS),
so I modified official khronos header by changing the include to using "".
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5815 dfc29bdd-3216-0410-991c-e03cc46cb475
While COpenGLCoreCacheHandler wasn't meant to be accessed externally, it is possible with some hacks (a few casts and including internal headers) and sometimes necessary.
And that's one of the state-flags people have a need to know from outside the engine.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5814 dfc29bdd-3216-0410-991c-e03cc46cb475
Before they could get pretty large as each node used the maximum memory it started with.
Also some changes to avoid unnecessary memory re-alloction when creating it.
Thanks @Squarefox for reporting the problem and proposing a patch.
See discussion at: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=52484
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5813 dfc29bdd-3216-0410-991c-e03cc46cb475
Thx@ Squarefox for reporting (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=52484)
Basically the loop was split into 2 loops so children do their allocations after the parent node
has finished his. Otherwise we got fragmentation by chaotic allocation order where parents/childs
switched all the time.
Also indention of loop changed (sorry, should have done that before).
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5812 dfc29bdd-3216-0410-991c-e03cc46cb475
In r5805 they got broken when adding compile-flags for them.
Copy-paste error, define was missing a '_' at the end in some places, sorry.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5810 dfc29bdd-3216-0410-991c-e03cc46cb475
We already had the variable, just no access function.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5809 dfc29bdd-3216-0410-991c-e03cc46cb475
(probably was added accidental, as it was always enabled that way which kills it's original purpose).
Thx@ LunaRebirth for report (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=1&t=52471)
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5807 dfc29bdd-3216-0410-991c-e03cc46cb475
Following flags got added:
_IRR_COMPILE_WITH_OCTREE_SCENENODE_
_IRR_COMPILE_WITH_TERRAIN_SCENENODE_
_IRR_COMPILE_WITH_SHADOW_VOLUME_SCENENODE_
_IRR_COMPILE_WITH_BILLBOARD_SCENENODE_
_IRR_COMPILE_WITH_WATER_SURFACE_SCENENODE_
_IRR_COMPILE_WITH_SKYDOME_SCENENODE_
_IRR_COMPILE_WITH_CUBE_SCENENODE_
_IRR_COMPILE_WITH_SPHERE_SCENENODE_
Also the corresponding _NO_IRR_COMPILE_WITH... flags certainly.
More such flags might be added in future, but will test first if it really makes a difference for WebGL apps which were the main reason to add this.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5805 dfc29bdd-3216-0410-991c-e03cc46cb475
Names like "my%20texture.png" will now load "my texture.png". Collada filenames are in xs:anyURI format.
xs:anyURI is used in more places, but we don't support any other file-loading inside Collada so far, so that was the most important place to fix.
Also added/fixed a few comments.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5793 dfc29bdd-3216-0410-991c-e03cc46cb475
CColladaMeshWriter::pathToURI tries to create now a correct name in xs::anyURI format (was more like xs::NCName before)
Note that the Collada loader in Irrlicht doesn't handle escaped characters yet, so right now can't load textures with space in names anymore written by Irrlicht.
That needs another fix in loader (it fails also when the .dae was written by other applications).
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5789 dfc29bdd-3216-0410-991c-e03cc46cb475
Done similar as it was done in CWGLManager::activateContext, thought not tested as I currently have no test-case for this on X11.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5785 dfc29bdd-3216-0410-991c-e03cc46cb475
The reset was prevented before, likely to make the use in beginScene easier. But it's necessary for using an OGL context from another thread.
Only implemented for WGL so far, GLX implementation will follow soon.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5784 dfc29bdd-3216-0410-991c-e03cc46cb475
If it ever has same texture twice in it's cache that would be a bug and this slows texture removing down unnecessarily.
Also wasn't correct anyway as it would have missed it if there were 2 times in a row the same texture as the loop index wasn't adapted after the erase.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5778 dfc29bdd-3216-0410-991c-e03cc46cb475
Basically the destructor tried to call a function to drop() itself, but that certainly prevented the constructor from being called in the first place as there still was a reference.
No need to backport to 1.8, this was caused by some rewrites in Irrlicht 1.9 back when TextureCache for active materials got added to the driver.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5777 dfc29bdd-3216-0410-991c-e03cc46cb475
Last change (in r5766) fixed GL and messed up D3D. This needs to use a parameter to tell what the matrix does.
Thx @DevSH for reporting.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5776 dfc29bdd-3216-0410-991c-e03cc46cb475
The test which uses it is currently disabled as it has more problems (broken stencil), but this part is fine and probably just changed due to recent opengl fixes.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5774 dfc29bdd-3216-0410-991c-e03cc46cb475
SViewFrustum::recalculateBoundingBox no longer includes camera position in the bounding-box. Only using frustum corners now. Thx @DevSH for bugreport & patch.
CMatrix4::transformPlane was calculating the wrong plane-normal before. It added the matrix translation and also didn't normalize the normal.
planeMatrix tests had been checking for wrong results (did check calculations by hand now, so hopefully I got it right, anyone double-checking it for me would certainly be cool...)
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5773 dfc29bdd-3216-0410-991c-e03cc46cb475
Fixes wrong near-plane values with OpenGL (showed too much before).
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5772 dfc29bdd-3216-0410-991c-e03cc46cb475
Sorry, forgot some brackets around addition earlier on :-(
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5771 dfc29bdd-3216-0410-991c-e03cc46cb475
It fails, but it failed before (test is outcommented since a long time, will have to check why)
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5770 dfc29bdd-3216-0410-991c-e03cc46cb475
Can now have target range of -w to w instead of only 0 to w.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5769 dfc29bdd-3216-0410-991c-e03cc46cb475
Old projection matrices always projected z from 0 to 1. For OpenGL we want a -1 to 1 target instead.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5768 dfc29bdd-3216-0410-991c-e03cc46cb475
Note: It would likely be nicer if it wouldn't switch back to a projection matrix at all but stay with ortho-matrix. But until I get to that - this will at least return the correct flag.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5767 dfc29bdd-3216-0410-991c-e03cc46cb475
SViewFrustum::setFrom now sets the correct near clipping plane when the projection matrix doesn't use a target depth range of 0 to z, but for example -z to z.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5766 dfc29bdd-3216-0410-991c-e03cc46cb475
We also did just read that box and then dropped the info immediately, so it wasn't used anyway. Not sure what that code was about, I hope it was just accidental and not about support for some strange Collada files in the wild.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5759 dfc29bdd-3216-0410-991c-e03cc46cb475
It already worked correct when Z_UP was set (we switched x/z in that case which also flips coordinate system)
But for the default (Y_UP) it had been wrong before (that one is still right-handed in Collada).
We do now convert all z to -z (so z coordinates do change, but it prevents objects from showing up mirrored).
Note: For readLookAtNode I also added code to regard Z_UP, but have no test-case yet.
Note: I have no test-case for readSkewNode, so not sure about that one.
Note: No fix for readBboxNode as I'm going to kick that out next.
I tested with Blender (which has no textures) and Collada (which needs manual adaptions in .dae files as Irrlicht can't read libraries order independent, but that's another problem).
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5758 dfc29bdd-3216-0410-991c-e03cc46cb475
isdigit, isspace and isupper had #undef's before them. But our own replacement implementations are in a namespace, so there shouldn't be any conflicts. And if there are compile conflicts they should show that the wrong implementation is used, so we would want to see them.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5728 dfc29bdd-3216-0410-991c-e03cc46cb475