www.tombraiderforums.com

Go Back   www.tombraiderforums.com > Tomb Raider Modding > Tomb Raider Level Editor > Software Development

Reply
 
Thread Tools
Old 16-06-13, 19:16   #91
TeslaRus
Student
 
TeslaRus's Avatar
 
Join Date: Jan 2013
Posts: 195
Default Textures

This time implements texture loading only from level file. In the future I will add external textures loading. This time I think about climbing system... maybe It is better to use ghost objects in the climbable places (xor not)...
TeslaRus is offline   Reply With Quote
Old 16-06-13, 19:22   #92
Turbo Pascal
Student
 
Join Date: Jan 2004
Location: Central America
Posts: 111
Default

Quote:
I've also implemented the texture atlas that I talked about before, and I thought I'd give some background information on this for the non-programmers who are interested.
Texture atlas is great, indee will cut the texture switch state;just be warned there is a problem later if you want to implement Mip-map feature, you know that feature where the videocard makes low resolution textures copies which are swiched automatically based in distance. Mip maped textures atlas shows ugly artifacts in texture borders; Ensy can vauch about that.

Still you need to put all transparency polys in his own drawcall, and if you want to implement bump map then that is another switch state and drawcall.

maybe you could be interested in some rants i post about this topic:

Rendering optimize rant..

Last edited by Turbo Pascal; 16-06-13 at 19:25.
Turbo Pascal is offline   Reply With Quote
Old 16-06-13, 19:40   #93
TeslaRus
Student
 
TeslaRus's Avatar
 
Join Date: Jan 2013
Posts: 195
Default Textures

Quote:
Mip maped textures atlas shows ugly artifacts in texture borders; Ensy can vauch about that.
Aha, I use mipmap in 256x256 original blocks. In every block there are different materials. I think about mipmap artifacts... It is good that some blocks are isolated with black colour pixels.
Thanks for link, I will read it.
TeslaRus is offline   Reply With Quote
Old 16-06-13, 19:46   #94
Turbo Pascal
Student
 
Join Date: Jan 2004
Location: Central America
Posts: 111
Default

Quote:
maybe It is better to use ghost objects in the climbable places (xor not)...
That does it mean someone will have to place that manually?

Ghost objects in the climbable places is obviosly the way used in Crystal Dinamics´s Tomb raiders; but that only works when someone is "doing" the level.

In standard clasic Tomb raider levels, climb from floor geometry should no be hard, heights are in 256 multiples values, and there are only about 4 climbing animations/heights well reorganized; if your problem is about sincronizing the climb animation.

If you are having troubles i guess it is suporting climbing in static and movables mesh or geometry from meta2tr where heights are non standard, so sincronizing the climb animation will need some nice ajustment to look right.
Turbo Pascal is offline   Reply With Quote
Old 16-06-13, 19:53   #95
meta2tr
Historian
 
Join Date: Apr 2008
Posts: 368
Default

Quote:
Originally Posted by TeslaRus View Post
I fix meta2tr texture trouble (with rarely exclusions). Next image - "newlevel.tr4"
Hey thanks for fixing that

The highest number of texture pages I have seen in a level is 1098. It is one of psiko's Hypersquare levels.

Last edited by meta2tr; 16-06-13 at 19:56.
meta2tr is offline   Reply With Quote
Old 16-06-13, 20:09   #96
Dustie
Relic Hunter
 
Dustie's Avatar
 
Join Date: Apr 2005
Location: Poland
Posts: 9,102
Default

What a fantastic job you guys are doing! It would be amazing to get a new engine, up-to-date with modern video games design.
Dustie is offline   Reply With Quote
Old 16-06-13, 22:44   #97
Lwmte
Explorer
 
Join Date: Aug 2010
Posts: 939
Default

Speaking about texture atlas, TP is pointed out that major drawback of it is texture border "bleeding" in mipmaps, which happens because of filtering. What I offered to TP is to extract and filter each tile, and then put it into mipmapped atlas independently. Here is the detailed explanation of this technique. However, it was only a random idea, and I never saw implementation of it in code.

Another, and most widely used technique is to add padding for each tile (clamp it). You can read about it here, or just google "texture atlas mipmapping", and you'll get a bunch of info about this. I guess, this technique is easier to implement, especially in OpenGL.

GREAT job with VBOs, I got 2x FPS increase in most scenes, however, RetroFit gives much more FPS in same situations, I guess, it's because it uses shaders?

Also, meta2tr levels finally working fine; only big trouble that now persists is the controls lag in some custom levels, which is not related to rendering speed (for example, try to load OT1.tr4 from Armageddon's Temple 2, and you will understand what I'm talking about).
Lwmte is offline   Reply With Quote
Old 17-06-13, 04:02   #98
Cochrane
Gold Contributor
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,043
Default

Quote:
Originally Posted by Turbo Pascal View Post
Texture atlas is great, indee will cut the texture switch state;just be warned there is a problem later if you want to implement Mip-map feature, you know that feature where the videocard makes low resolution textures copies which are swiched automatically based in distance. Mip maped textures atlas shows ugly artifacts in texture borders; Ensy can vauch about that.

Still you need to put all transparency polys in his own drawcall, and if you want to implement bump map then that is another switch state and drawcall.

maybe you could be interested in some rants i post about this topic:

Rendering optimize rant..
Yeah, I've noticed that issue. I still have to think what I'll do about it; maybe smaller and thus more textures or something like that.

Transparent polygons and bump map polygons aren't a big problem. There are just not that many of them, so if rendering them is slow, who cares? Getting the normal case optimal is where the big wins can be found.

A note about that rant: At least on Mac OS X, it's changes to glEnable state or similar mode switches that hurt a lot; changing the currently bound texture or VBO is not that big a deal. Internally it's all implemented with shaders, so the state changes that hurt are those that require the driver to choose a new shader, or at least check if the current shader is still appropriate. Those that just change the equivalent of uniform values are okay. That may be different on other platforms with other graphics drivers, of course.

Quote:
Originally Posted by meta2tr View Post
Hey thanks for fixing that

The highest number of texture pages I have seen in a level is 1098. It is one of psiko's Hypersquare levels.
Oh my god… are you sure that's not a typo?

Quote:
Originally Posted by Lwmte View Post
Speaking about texture atlas, TP is pointed out that major drawback of it is texture border "bleeding" in mipmaps, which happens because of filtering. What I offered to TP is to extract and filter each tile, and then put it into mipmapped atlas independently. Here is the detailed explanation of this technique. However, it was only a random idea, and I never saw implementation of it in code.
I'm not certain that it actually provides advantages for typical TR levels. All textures are aligned on multiples of four pixels anyway, so a resize version that's not overly smart will basically create the same result for the first two or three mipmap levels anyway, and after that it is just not possible to avoid this bleeding.

Quote:
Originally Posted by Lwmte View Post
Another, and most widely used technique is to add padding for each tile (clamp it). You can read about it here, or just google "texture atlas mipmapping", and you'll get a bunch of info about this. I guess, this technique is easier to implement, especially in OpenGL.
Yah, that is easy to do (although it makes some maths a bit more annoying, but that's not a big issue).

Quote:
Originally Posted by Lwmte View Post
GREAT job with VBOs, I got 2x FPS increase in most scenes, however, RetroFit gives much more FPS in same situations, I guess, it's because it uses shaders?
Shaders are a big part of it, but not all. I've implemented some more optimizations on the Mac version (not yet on SF due to a wonky Internet connection):
- Indices in VBO, too.
- Interleaved vertex arrays (in the buffer).
- More triangles per draw call if they all have the same texture. That obviously wins more with the texture atlas, but I'm certain (I'll have to do some experiments) that it also speeds up things a lot without it.

In general, there is still way too much redundant state switching between draw calls. I'll try to see whether I can fix that later today. My goal is to get all rendering of textured/colored meshes completely separate from rendering anything that draws lines for debugging.
__________________
Güter auf die Bahn!
Cochrane is offline   Reply With Quote
Old 17-06-13, 10:53   #99
meta2tr
Historian
 
Join Date: Apr 2008
Posts: 368
Default

Quote:
Originally Posted by Cochrane View Post
Oh my god… are you sure that's not a typo?
No it isn't. The size of the tr4 file is 177Mb. This level isn't released yet but if you need levels with a high number of texture pages for testing, let me know and I'll see what I can do.
meta2tr is offline   Reply With Quote
Old 17-06-13, 11:47   #100
Cochrane
Gold Contributor
 
Cochrane's Avatar
 
Join Date: Apr 2006
Location: Germany
Posts: 16,043
Default

Quote:
Originally Posted by meta2tr View Post
No it isn't. The size of the tr4 file is 177Mb. This level isn't released yet but if you need levels with a high number of texture pages for testing, let me know and I'll see what I can do.
I'll keep this in mind, though for the moment, I think I'll just try to get normal levels running properly.

Edit to add: I've implemented this reduction of state switching, and the performance win was very notable. I'll post this to SourceForge later (currently I'm in a train with only my cell phone as Internet connection). Right now, I'd say that with these changes, the app is as optimal as it gets. There are quite a lot of optimizations that can still be made, but there isn't really any point. It's just a lot of work for no real change in the frame rate.
__________________
Güter auf die Bahn!

Last edited by Cochrane; 17-06-13 at 15:51.
Cochrane is offline   Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 05:57.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.