Sharing texturemap globally with all features...?
Moderator: Moderators
Sharing texturemap globally with all features...?
How much changes this would require in Spring source code?
Anyways, this would speed up rendering a lot when using a simple tilemap for all the feature textures.
I'm planning to make a city map with buildings as features, and the buildings are basically made out of squares which takes the texture from the tilemap. But, i am worried about the rendering speed with many different features spread all over the map...
Now i need to create own tilemap for each building, its not really a problem, but when you have lots of buildings in the map, wouldnt it be a lot slower to draw all those features when it needs to change the texture all the time?
I wouldnt need bigger tilemap than 1024x1024 or 3 * 512x512. Though, multiple tilemaps would make a problem too, if one feature uses more than one tilemap...
I am afraid that this idea just wont work, but it is worth a try
---
btw, can i use floating points to tell which coordinates i take the tile from the texturemap? this is essential for drawing the textures correctly for my buildings.
Anyways, this would speed up rendering a lot when using a simple tilemap for all the feature textures.
I'm planning to make a city map with buildings as features, and the buildings are basically made out of squares which takes the texture from the tilemap. But, i am worried about the rendering speed with many different features spread all over the map...
Now i need to create own tilemap for each building, its not really a problem, but when you have lots of buildings in the map, wouldnt it be a lot slower to draw all those features when it needs to change the texture all the time?
I wouldnt need bigger tilemap than 1024x1024 or 3 * 512x512. Though, multiple tilemaps would make a problem too, if one feature uses more than one tilemap...
I am afraid that this idea just wont work, but it is worth a try
---
btw, can i use floating points to tell which coordinates i take the tile from the texturemap? this is essential for drawing the textures correctly for my buildings.
Re: Sharing texturemap globally with all features...?
Afaik it wont affect speed, only gpu ram use.
Re: Sharing texturemap globally with all features...?
You mean in Spring it wont affect on speed? ...why?
as far as i know, changing the texturemap affects rendering speed, thats why they use tilemaps, instead of making each tile into own texture...
as far as i know, changing the texturemap affects rendering speed, thats why they use tilemaps, instead of making each tile into own texture...
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: Sharing texturemap globally with all features...?
Usually tilemaps only make sense when you've got a lot of what's put in it on screen all the time. So in your case it wouldn't be that much of an advantage. So individual textures might be the better solution for you anyway...
Today you can handle textures of a nice resolution for the entire map like it's done for the sm3 maps which (if not due to some bad programming of the smf system) run way faster on current machines than smf maps...
How do you mean that? If you're talking about the smf map system where the map consists of tiles - that's a solution that's mostly about older systems where textures like 2048x2048 were huge and using them was not that wise. So instead of doing one big texture for all the terrain you get more details for your map by repeating certain tiles over and over...Trademark wrote:as far as i know, changing the texturemap affects rendering speed, thats why they use tilemaps, instead of making each tile into own texture...
Today you can handle textures of a nice resolution for the entire map like it's done for the sm3 maps which (if not due to some bad programming of the smf system) run way faster on current machines than smf maps...
Re: Sharing texturemap globally with all features...?
you are saying changing texture coordinates vs changing texture doesnt make much speed difference in rendering?
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: Sharing texturemap globally with all features...?
Yeah. To make things more clear: It usually is faster to load a small needed texture process it, "discard" it, load the next small needed texture, "discard" it and so on for whatever usual models you have than doing the same over and over with one big texture...
Putting it all in a tilemap only speeds up things when you can be pretty sure that most of what's stored in it will be visible like all the time and if integrated right you won't have so much loading / unloading of a texture but can skip this...
Putting it all in a tilemap only speeds up things when you can be pretty sure that most of what's stored in it will be visible like all the time and if integrated right you won't have so much loading / unloading of a texture but can skip this...
Re: Sharing texturemap globally with all features...?
Master-Athmos wrote:Usually tilemaps only make sense when you've got a lot of what's put in it on screen all the time. So in your case it wouldn't be that much of an advantage. So individual textures might be the better solution for you anyway...
..
How do you mean that? If you're talking about the smf map system where the map consists of tiles - that's a solution that's mostly about older systems where textures like 2048x2048 were huge and using them was not that wise. So instead of doing one big texture for all the terrain you get more details for your map by repeating certain tiles over and over...
Today you can handle textures of a nice resolution for the entire map like it's done for the sm3 maps which (if not due to some bad programming of the smf system) run way faster on current machines than smf maps...
sorry but I never heard that much smattering ...Master-Athmos wrote:Yeah. To make things more clear: It usually is faster to load a small needed texture process it, "discard" it, load the next small needed texture, "discard" it and so on for whatever usual models you have than doing the same over and over with one big texture...
Putting it all in a tilemap only speeds up things when you can be pretty sure that most of what's stored in it will be visible like all the time and if integrated right you won't have so much loading / unloading of a texture but can skip this...
everything you said is wrong...
And iirc I already explained it to you, so I won't do it again here.
@Trademark
What prevents you to use the same texture for all your features?
Re: Sharing texturemap globally with all features...?
Indeed, this is perfectly possible already, even without using any lua or anything.
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: Sharing texturemap globally with all features...?
Well I asked some engine devs I know in another forum and they all told me this plus that a tilemap would be "strange" at its best for a particle system (which is what that other topic was about). But as it's a bit futile discussing this (as I don't see this system being changed anytime especially as it's not bad) I didn't derail things back then bringing this whole discussion up...jK wrote:sorry but I never heard that much smattering ...
everything you said is wrong...
And iirc I already explained it to you, so I won't do it again here.
Re: Sharing texturemap globally with all features...?
Because im not sure how Spring optimizes it... does it copy it as many times as i have features using that texture (and fill the GPU memory...), or does it bind the texture only once and then draw stuff with it?jK wrote:@Trademark
What prevents you to use the same texture for all your features?
wut? i heard every feature needs own texture map -_-FLOZi wrote:Indeed, this is perfectly possible already, even without using any lua or anything.
So how exactly it works?
Im not sure did you understand what i meant, which is: 1) i load one texture. 2) all my features would use this texture for drawing their triangles. (without binding the texture again for every feature, even when its exactly the same texture...)
---
Plus, could someone give any info/links what is the features file format? I'm attempting to do some automatic feature generator/placing for these buildings.
If not, could you answer some questions:
1) Can i adjust the texture coordinates with floating points values?
2) Can i set features statically on some specific position on the map?
3) if not, can i/how can i move the feature exactly at some point in the map.
4) Can i shade the triangles without changing the texture colors darker? Or does Spring do it for me? If it does, can i disable it?
5) How big features i should create for maximum? eg. how spring renders them on the screen edges... (if some big features disappears at screen edges, that would look stupid :D)
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: Sharing texturemap globally with all features...?
Features use the same formats as standard units do - i.e. 3do or s3o (don't forget the ".s3o" ending in the definition file when using s3os)...Plus, could someone give any info/links what is the features file format? I'm attempting to do some automatic feature generator/placing for these buildings.
I'm not sure how you mean that. When you do s3os the texture / the spaces of the texture you are going to use gets applied via the UV-map. Doing a shift on the UV space shouldn' be doable as a "Spring feature". I only could imagine using a shader or even ffp function (there was one for simple UV-shifting) applied via Lua...1) Can i adjust the texture coordinates with floating points values?
Unless you write your own Lua code which spawns features at specific positions you place features via the featuremap which is an additional texture you include in the map. I guess you just look it up in the wiki like here:2) Can i set features statically on some specific position on the map?
3) if not, can i/how can i move the feature exactly at some point in the map.
http://springrts.com/wiki/IceXuick_Map_Design_Help
Hmm - I know of no way of having any control about the shading except for hackish use of Lua and a self-written shader...4) Can i shade the triangles without changing the texture colors darker? Or does Spring do it for me? If it does, can i disable it?
Re: Sharing texturemap globally with all features...?
I know what you meant. S44 infantry have done it since the first iteration of them as s3o's...TradeMark wrote:Because im not sure how Spring optimizes it... does it copy it as many times as i have features using that texture (and fill the GPU memory...), or does it bind the texture only once and then draw stuff with it?jK wrote:@Trademark
What prevents you to use the same texture for all your features?
wut? i heard every feature needs own texture map -_-FLOZi wrote:Indeed, this is perfectly possible already, even without using any lua or anything.
So how exactly it works?
Im not sure did you understand what i meant, which is: 1) i load one texture. 2) all my features would use this texture for drawing their triangles. (without binding the texture again for every feature, even when its exactly the same texture...)
---
Plus, could someone give any info/links what is the features file format? I'm attempting to do some automatic feature generator/placing for these buildings.
If not, could you answer some questions:
1) Can i adjust the texture coordinates with floating points values?
2) Can i set features statically on some specific position on the map?
3) if not, can i/how can i move the feature exactly at some point in the map.
4) Can i shade the triangles without changing the texture colors darker? Or does Spring do it for me? If it does, can i disable it?
5) How big features i should create for maximum? eg. how spring renders them on the screen edges... (if some big features disappears at screen edges, that would look stupid :D)
Re: Sharing texturemap globally with all features...?
Great! Is there rendering speed difference between s3o and 3do formats? (except that 3do cant use shared textures i guess)FLOZi wrote:I know what you meant. S44 infantry have done it since the first iteration of them as s3o's...
i dont know about modelling anything, but i know rendering, and how i give texture coordinates in rendering, thats what im talking about. Can i give floating point values (not integer values) to tell which coordinates from the texture map it takes the texture.Master-Athmos wrote:I'm not sure how you mean that. When you do s3os the texture / the spaces of the texture you are going to use gets applied via the UV-map. Doing a shift on the UV space shouldn' be doable as a "Spring feature". I only could imagine using a shader or even ffp function (there was one for simple UV-shifting) applied via Lua...TradeMark wrote:1) Can i adjust the texture coordinates with floating points values?
And no i dont want LUA.
Yeah i know features are placed by that texture, but, i know that features are dropped on the ground, and they have some mid-point which touches the ground and determines which height the feature will be placed on.Master-Athmos wrote:Unless you write your own Lua code which spawns features at specific positions you place features via the featuremap which is an additional texture you include in the map. I guess you just look it up in the wiki like here:TradeMark wrote:2) Can i set features statically on some specific position on the map?
3) if not, can i/how can i move the feature exactly at some point in the map.
I was thinking i could just give it a color value, like you can do in opengl with glColor3f() function :DMaster-Athmos wrote:Hmm - I know of no way of having any control about the shading except for hackish use of Lua and a self-written shader...
Last edited by TradeMark on 27 Jul 2009, 20:29, edited 1 time in total.
Re: Sharing texturemap globally with all features...?
alright thenTradeMark wrote:(except that 3do cant use shared textures i guess)
Re: Sharing texturemap globally with all features...?
what?Peet wrote:alright thenTradeMark wrote:(except that 3do cant use shared textures i guess)
-
- Posts: 916
- Joined: 27 Jun 2009, 01:32
Re: Sharing texturemap globally with all features...?
Well I guess you know then how the entire UV-mapping process works. Concerning your coordinate question: No there is no "standard" way of influencing the respective vertice positions on the UV-map. You'd need to write an "interface" for this by yourself...i dont know about modelling anything, but i know rendering, and how i give texture coordinates in rendering, thats what im talking about. Can i give floating point values (not integer values) to tell which coordinates from the texture map it takes the texture.
And no i dont want LUA.
Just out of curiosity: What exactly do you want to do with floating point values / why do you really want those?
Coordinate 0,0,0 of your model defines its "root". So you place your model inside e.g. Upspring in a way that its bottom "touches" the 0 level of the height axis. When being placed on the map the model then touches the ground (or not if placed too high)...Yeah i know features are placed by that texture, but, i know that features are dropped on the ground, and they have some mid-point which touches the ground and determines which height the feature will be placed on.
Well you still can do that but you'd need to change Spring's standard way of shading / texturing a model as this isn't something you can access via e.g. just setting some values in an FBI...I was thinking i could just give it a color value, like you can do in opengl with glColor3f() function :D
Re: Sharing texturemap globally with all features...?
Peet was subtly pointing out that you seem to be blissfully unaware of the fact that Spring merges all 3DO textures into a global atlas already (two even). If on the other hand you want S3O models to share parts of a texture image, then you'll have to follow this highly complex procedure instead:trademark wrote:what?
1. make "atlas" texture T which combines parts unique to model M1, M2, ...
2. make model M1 and assign T to it
3. make model M2 and assign T to it
4. give M1 UV-coordinate set S1 wrt. T
5. give M2 UV-coordinate set S2 wrt. T
6. ???
7. profit!
Re: Sharing texturemap globally with all features...?
to shift the texture coordinates by 0.5 pixels. It is very essential procedure to make my textures look as they should.Master-Athmos wrote: Just out of curiosity: What exactly do you want to do with floating point values / why do you really want those?
Re: Sharing texturemap globally with all features...?
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFTradeMark wrote:(except that 3do cant use shared textures i guess)
Re: Sharing texturemap globally with all features...?
anyone know the s3o file format definitions?