Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Bobboau on May 14, 2005, 01:05:18 pm
-
ok, the next thing to do in the materials checklist is global textures, and I'm not sure exactly how I want this.
a global texture is one that will be used by name accross all iterations of a texture (irrespective of what model is being drawn). they can be loaded from a file or made dynamicly and can have a whole bunch of atributes set for them. I need to get this done because environment mapping uses a global texture namely the environment map. but as I said, I'm not sure on the best way to do this.
for one thing should it be part of the materials table or something seperate? the HUD might end up useing global textures to output gagues to, and then you'd be able to grab those global textures in the material and make cockpits.
what about the table entree, what I have right now is
$Name: static_env
$render_target:
+type: cubemap
+Resolution: 512
+memory_pool: static
$format: RGB, 32
$Name: noise
$src: noise.tga
$format: RGBA, 32
global textures would be refered to by name, you can load it from a file, or it can be a render target (and if it's a render target you have to specify resolution and stuff) and you'd be able to change formats if you wanted.
so what do other people think?
-
Makes sense the way you described it.
I don't see any way to do it better. I can work with this.
-
Have you cleared the bugs assigned to you?
-
this is the first chance I've had to code in three weeks and my code base is unmergeable, so no.
-
We can't get anywhere if you don't you know ;)
You can have multiple CVS copies downloaded to your HD ;)
It's exciting to add new stuff, but some of those bugs are yours, if they ain't, re-assign em to someone who can fix 'em.
-
sounds about right. i figure most textures will just use the existing system of maps. so the renderer should be smart enough to know what global material to use based on the avbailability of maps. for example if you have a difuse map , a glow map, and a shine map with and env map in the alpha chanel it should know to use the proper global material to use all the maps, however if you just have a difues map with a shine map with no env it should also be smart enough not to use env, or to use a global env texture. it should be able to autosence what material to use based on whar maps are available first, the only exception is that if there is a material script. so if you have the diffue and alpha less shine map shine map and the table entry says to use the blue chanel for env, then it would. just maintain the current system of defaults.
-
ehh.. that has nothing to do with what I want to talk about here, this is a way to define textures that are used consistantly throut a material, like a noise texture for detail mapping, or a light map for cell shadeing. textures that would be used by all instances of a material across all objects, and I want to figure out the best syntax for it, also wondering if it should be completely seperate so other things (like the HUD) could take advantage of them (want WMC's input mostly here).
-
so you use these things to define a default env map for example? i see, then in that case it should work fine.
-
no, they are something that will be the same on all ships useing the material, everything that uses environment mapping uses the same environment map. the environment map is the thing with the background image on it not the shine map or a part of it.
there a pool of textures that are always there and always loaded/made seperate from the textures loaded with models.
get me yet?
-
So the model can use multiple 'local' textures and one glwobal texture?
Could you point out one or two possiblilites this feature offers?
-
So say you have two ships with the smae texture, that texture will be loaded inot memory only once??
-
not really, i guess il figure it out eventually
-
ok... a perfict example of were you would use this is detail mapping, in detail mapping you have one noise texture, it's just a bit of random pixels that are just a bit lower thanfull brightness, you then set up the scaleing matrix so that the noise has a higher frequency (so it tiles more, you scale it so the immage is smaller) and then you multiply this with the defuse texture, then you multiply that with the defuse light.
environmment mapping is another, all environment mapped ships use the same environment map _all_ of them, they do right now in the current implementation. the only thing unique to a ship in this regard is the shine map that get's multiplied.
currently in the material the only way to reference a texture is to specify with texture of the ones the model wanted to load are suposed to be used, these change with each model and with each use of a material.
-
So this is basically like a global variable, except with a type of texture?
-
so in other words its just a library of basic effects bitmaps that are pulled by various materials as needed?