Commit Graph

3421 Commits (master)

Author SHA1 Message Date
cutealien b93be7c49c Add some readme.txt's to folders which would otherwise be empty in source-control-systems.
Just making life a little easier for the hg & git crowd.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5688 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-18 15:17:34 +00:00
cutealien 957d34ff0e Switch Irrlicht to 8 textures per Material as default by increasing value of _IRR_MATERIAL_MAX_TEXTURES_.
Reason is that 4 haven't been enough anymore for even pretty common graphic pipelines for a while now. 
8 might still not be enough, but let's see first if people are happy with it.

This has some costs for people not needing more textures, as we have fatter Materials now. 
- Memory usage increases by 64 bytes per SMaterial.
- Serialization files for the irr-format are now larger. 
- Slight speed cost, thought mainly in debug

For people who don't need this and want to avoid some of the costs there is a new variable irr::video::MATERIAL_MAX_TEXTURES_USED which can be set to the maximal number of textures a project will need
before creating any device. This avoids pretty much all speed-costs involved with this change.

Software drivers are not much affected as they use their own texture-limits (2).

I did a few speed-comparison with varying numbers of _IRR_MATERIAL_MAX_TEXTURES_. The numbers displayed are FPS, so higher is better. I had 2 tests - one which forced many material changes and the other used a single material for all nodes. When there are 2 numbers in a result then I got different (generally lower) FPS when forcing material changes. The test used a simple model with 500 polygons and rendered it 4500 times.
OLD means - before working on all changes related to increasing texture-numbers and without changing materials (found a bunch of places to decrease the impact of this change which also sometimes did speed up Irrlicht generally). 1.8 refers to Irrlicht 1.8 with same test. All tests done on Windows/VisualStudio.

Max.textures    4       8       16      64      64 MATERIAL_MAX_TEXTURES_USED=4
GL/debug        50/68   44/58   35/45
GL/release      117     117     117     80/100  117	
D3D9/debug	51/56	45/49	37/39				
D3D9/release    168     168     152/168 90/87   168
OLD GL/debug    63
OLD GL/release  117
OLD D3D9/debug  44
OLD D3D9/rel    168
1.8 GL/debug    23/29
1.8 GL/release  94/117
1.8 D3D9/debug  59/63
1.8 D3D9/rel    142/152

Take all results with a grain of salt, it probably often is limited by fill-rate and doesn't even notice the texture-number changes (especially in release). 

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5682 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-17 15:34:57 +00:00
cutealien 60b295bcdb Can't avoid writing empty textures or SMaterial.
I changed that while fixing SMaterial serialization, but bad optimization. Editors needs the info even when it's empty or it can't offer options to user.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5681 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-17 14:32:03 +00:00
cutealien 6bf700d408 Remove compile warnings.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5680 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-17 14:24:11 +00:00
cutealien abd0fa9dec Fix several problems with SMaterial serialization.
SMaterial.ZWriteFineControl only using 1 bit now.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5679 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-17 14:19:18 +00:00
cutealien f34b03f4bd Add MATERIAL_MAX_TEXTURES_USED to allow setting a limit of used textures in materials.
CD3D9Driver::setTransform limits no longer to MATERIAL_MAX_TEXTURES, but to MaxTextureUnits.
COpenGLCoreFeature::TextureUnit renamed to COpenGLCoreFeature::MaxTextureUnits (same as Direc3D names it and slightly better description)
Limiting used texture numbers with MATERIAL_MAX_TEXTURES_USED is currently not making a big speed difference. But it has a more noticable effect when we increase _IRR_MATERIAL_MAX_TEXTURES_ soon. It allows software which doesn't need more textures to mostly keep old speed.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5678 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-16 21:18:43 +00:00
cutealien a70e6ce6e7 Create pdb file also in release.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5677 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-16 21:01:27 +00:00
cutealien b737b425ba Checking TextureMatrix pointer before de-allocating.
While possibly double-checking the pointer now (which would be slightly slower when it's non-0), it's generally increasing speed of SMaterialLayer as our allocator is still somewhat expensive when the pointer is 0 (which is generally the case). And the cost would increase further when we raise max texture numbers soon.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5676 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-16 20:53:37 +00:00
cutealien 91247910b8 No longer overwrite memory when compiling with _IRR_MATERIAL_MAX_TEXTURES_ set to a value > 8
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5675 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-16 18:22:04 +00:00
cutealien f16f173fcb setMaterial no longer changes texture-matrices in GL and D3D9 when no texture-pointer is set.
This increases speed slightly (mainly in debug and more so when we increase max-texture-limit soon).
Texture-matrices are only used together with textures in the fixed function pipeline and for shaders the users
have to to pass them anyway on their own.
So the main difference now is that after setMaterial calls with empty texture pointers we no longer get 
a changed texture matrix which can be checked with IVideoDriver::getTransform.
I suppose the main reason where we might want to still access that matrix without a textures is when it's abused to pass values for other stuff in shaders (which is still possible). 

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5674 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-11 18:26:04 +00:00
cutealien 07e458c643 OpenGL driver no longer changes active texture as often when it doesn't have to do anything with the texture.
Minor speed improvement, which also will make it less costly to increase max-textures in future.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5673 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-11 16:49:24 +00:00
cutealien c7a766c290 Get rid of compile warnings in CAnimatedMeshHalfLife.cpp
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5672 dfc29bdd-3216-0410-991c-e03cc46cb475
2019-01-02 11:44:43 +00:00
cutealien 7f60d679cc Remove .aps file from source control.
It's a binary representation of the resource file which shouldn't be checked-in as VS can rebuild it.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5671 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-12-22 23:17:34 +00:00
cutealien 2c7871d2f4 Fix memory leak in OpenGL for automatic generated rendertarget depthbuffer textures.
Didn't release old one when switching between between rt's with different sizes.
Also some refactoring to make code easier to read.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5670 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-12-04 16:01:12 +00:00
cutealien f4cce65ab1 Reset blend and alphatest states in GL and GLSL shader materials.
Those resets got removed in the materialrenderer rewrite in r4979, so sometimes we got wrong states now (stuck to blend or alphatest enabled when switching back to other materials). At least that was the case for alphatest, not so certain about blend which is also set in COpenGLDriver::setBasicRenderStates. That one is likely enabled/disabled more than once right now when setting up some materials (shader materials which have a transparent base material but SMaterial.BlendOperation != EBO_NONE). So better state-handling there could likely allow some speed optimization in the future.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5669 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-12-04 13:46:09 +00:00
cutealien b3e9af5722 Add IMaterialRenderer::getShaderConstantSetCallBack to allow access to user provided shader callbacks.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5668 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-12-01 15:55:32 +00:00
cutealien 386cbffe9a No longer set world transform twice in CMeshSceneNode.
I suspect that was just some copy-paste error (some other nodes need this).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5667 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-12-01 15:01:03 +00:00
cutealien 8f2eb13099 Allow to create images with floating point formats.
While IGUIImage doesn't support those well yet, it at least allocates memory and that turns out to be useful sometimes. For example we can now lock() floating point textures and access the data on OpenGL, which wasn't possible before. If this turns out to cause any problems (shouldn't really) we can handle them case-by-case.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5666 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-29 16:04:39 +00:00
cutealien b584c39295 ITexture::lock interface changed.
- mipmapLevel is now the second parameter as it was in Irrlicht 1.8 (but currently not doing anything)
- layer moved to third parameter
- New parameter lockFlags which allows to disabled flipping the texture upside down for RTT's on OpenGL.
Sorry for any inconvenience this change causes, but as I had to break the interface now anyway I decided to make it backward compatible to Irrlicht 1.8. Anyone already using the new "layers" feature in trunk will have to move the layer parameter now. But the last interface change which replaced the mipmaplevel with another variable with very different meaning wasn't a solution.
Mipmap support can also likely be re-introduced. At least I still haven't seen a real reason why it shouldn't be possible to have that anymore.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5663 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-22 19:13:59 +00:00
cutealien 343924adb7 Add IVideoDriver::addTextureCubemap function to create an empty cubemaps.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5662 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-22 14:40:34 +00:00
cutealien 05a05b75d1 Enable seamless filtering for cubemaps on OpenGL by default and add a new driver feature flag to disable it.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5661 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-20 15:47:13 +00:00
cutealien 7873503041 Fix test "renderTargetTexture"
Was using wrong parameter order when setting the rendertarget.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5660 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-19 21:50:24 +00:00
cutealien 665324b6a8 Switch COpenGLCoreTexture::lock to using glGetTexImage instead of glReadPixels.
Also got rid of extra temporary image. Main reason it didn't work before was likely because the image had not been set as active.
tests failing: 51,53,54 (some related to this, but none of those worked before, so no change there).
Note: Still keeping old code around a little longer as it's currently nice to have for comparison. If new stuff causes any preoblems, we could even make it optional somehow (some driver flag or so).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5659 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-19 15:24:48 +00:00
cutealien c5e36eb111 Minor change to COpenGLExtensionHandler::dump (internal use only).
And comment about WGL_CONTEXT_FLAGS_ARB (but debug not enabled).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5658 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-12 16:45:25 +00:00
cutealien a2e744faa5 Add current values as default values in serialization of several GUI elements.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5657 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-10 14:09:49 +00:00
cutealien fb7e234561 Add a default parameter to some IAttributes::getAttributeAsEnumeration functions.
Use existing values as default values now in serialization of CGUIEditBox.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5656 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-10 13:55:12 +00:00
cutealien 0ec5f98831 Fix default value for ScaleImage in CGUIImage::deserializeAttributes.
Thanks @chronologicaldot for the report: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=52405


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5655 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-10 13:33:55 +00:00
cutealien 57949584ed Add support for creating cubemap rendertargettextures on OpenGL.
Still having some troubles:
- Lock() returns very strange results
- The usual texture-flipping for rendertargets in opengl is causing here even more troubles than usual. Still working out how to render cubemaps into RTT's the same way as when just passing "normal" textures to a cubemap. Just putting them upside down isn't enough. 

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5654 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-09 19:16:50 +00:00
cutealien bc525f5dcc Fix ITexture::lock for D3D9Texture with RTT cubemaps.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5653 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-11-09 13:59:13 +00:00
cutealien 3b7216ed7c Bugfix: BillboardSceneNode must set meshbufferbuffer to dirty now.
(wasn't needed in the past when it wasn't using a real meshbuffer as new updates were send each frame anyway).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5651 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-10-29 21:35:36 +00:00
cutealien 243c124d85 Try restoring a lost device for 4 instead of 3 seconds. Better error messages for failed CreateTexture calls.
(time of restoring device is try&error really, with 3 seconds it seemed to work sometimes, but still failed in some cases, so just increasing it slightly to see if helps).

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5649 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-10-19 13:39:20 +00:00
cutealien 8518f3bd2c Revert r5645 (adding default value).
Reason: No c++11 code in Irrlicht 1.9 and also - this value already is default in core::string, so no need to set it.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5648 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-10-04 10:03:11 +00:00
dbocksteger c8ec2d3e05 Added Default-value for ISceneNode->Name so the code won't crash if someone tries to compare it with empty...
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5645 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-10-04 05:57:43 +00:00
cutealien 8f7f59d193 Simplify code in CGUITabControl (thx @chronologicaldot for patch-proposal).
Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=7&t=52344&p=304167#p304167


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5644 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-09-20 21:16:46 +00:00
cutealien 8868d47688 Fix serialization bug introduced in svn r5631.
That fix there was only missing some understanding of a strange side-effect.
Comment added so we don't run into it again (and solved slightgly different than before).


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5643 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-09-20 20:56:35 +00:00
cutealien 4edf23c775 Add serialization for ToolTip to IGUIElement. Thanks @chronologicaldot for fix.
Forum: http://irrlicht.sourceforge.net/forum/viewtopic.php?f=2&t=52374


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5642 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-09-12 09:47:38 +00:00
cutealien 01de5276ae Fix bug introduced in r5627 which generated certain rtt's on d3d9 now twice - which broke resetting the d3d9 device.
That check got accidentally deleted while adding support for cubemap rtt's.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5641 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-09-04 16:52:08 +00:00
cutealien 10a3f02aa6 Try recovering lost device in D3D9 for 3 seconds when device reset fails after resizing Window.
The device becomes useless if we don't recover it, so it's worth giving it a few more shots at that point as it might take a while until it can be recovered. The 3 seconds are just a number which seems to make some sense, could be it would be worth waiting even longer?

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5640 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-09-04 14:20:34 +00:00
cutealien b44b6891a6 Add typedefs like value_type and size_type to array, list and map like std containers have.
Thanks @SLC for idea (http://irrlicht.sourceforge.net/forum/viewtopic.php?f=1&t=52363)


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5639 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-08-23 09:52:13 +00:00
dbocksteger 27915916df readme.txt: fixed typo
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5635 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-08-14 07:19:47 +00:00
cutealien 0c57deec15 Simplify code (getAttributeAsBool didn't have default-paramters in the past).
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5633 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-07-24 20:13:16 +00:00
cutealien 09767f2541 Merge branch releases/1.8 revisions 5529-5631 into trunk:
- Add comment to Makefile about MinGW compilation
- Fix serialization of OverrideTextColorEnabled flag in CGUITab

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5632 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-07-24 20:11:37 +00:00
cutealien 438fb2a0ac Remove unused enum E_LOST_RESOURCE
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5630 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-07-19 20:25:34 +00:00
cutealien f6202b9e7b Update Windows version info slightly (at least tell it's Windows 8 or above).
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5629 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-07-19 20:22:40 +00:00
cutealien 2b4ec38555 Fix compile error on gcc. Thanks @AReichl for reporting.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5628 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-07-13 10:14:48 +00:00
cutealien b795ba324b Add support for cubemap rendertarget textures on D3D9.
(OpenGL still needs to be done).
Example will follow.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5627 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-07-12 19:19:11 +00:00
cutealien f41aad6c6d No longer try to restore RTT's with a lost device.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5626 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-07-04 17:56:38 +00:00
cutealien f873cd7916 Do no longer release DepthStencilSurface always in D3D9 device and then still work with it.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5625 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-07-04 17:50:34 +00:00
cutealien 7942f3dae6 Set ETCF_ALLOW_MEMORY_COPY to "on" by default.
This means opengl textures keep again a copy in main-memory as they did in Irrlicht 1.8.
The reason this is changed back is because otherwise ITexture::lock() for alpha-textures is broken by default.
This is a (long time reported) bug, but it has gone unfixed for over a year and caused too many problems.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5624 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-07-01 12:21:17 +00:00
cutealien 32c532ee36 Log parameters when CreateTexture call in CD3D9Texture::generateRenderTarget fails.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5623 dfc29bdd-3216-0410-991c-e03cc46cb475
2018-06-29 10:34:58 +00:00