completely transparent material?

正在查看此主题的用户

octoburn

Grandmaster Knight
I want to make a map texture transparent. don't ask why  :wink:

is there a native material that I could sub for native "map_plain" that is completely transparent? or some combination of shaders that will make a material transparent?

I have tried many things, testing off and on, but with minimal luck.

I also tried making my own texture (using Paint.net not photoshop) but I don't think it's working right either.


also, is there a way to disable the fog on the overland/world map? I figure it's not as simple as a "disable worlmap fog" option, but I can't seem to find anything about the for in particle systems or related files that would seem to relate.

thanks in advance :grin:
 
octoburn 说:
what shader did you use?

oh, good question, thank you very much!  You made me realize a few problems with my earlier test...

- I had accidentally compressed my transparent map file with DX1 compression, which I don't think works as transparency in M&B, so that is why it was probably black.  Here's a link to an uncompressed transparent texture....
http://rapidshare.com/files/159345234/map_steppe.dds.html

- I had just named this file, map_steppe.dds, and placed it in the textures folder so it just replaced the native texture and used the material in the BRF from the native game.  However, materials.brf uses "map_shader" which apparently doesn't work with transparency. So when I edited the native materials.brf file and switched the shader to "simple_shader" I got the following, holy crap!

       

I will definitely have to play around with this concept more.  The only issue is i've never been able to successfully add a new map texture into the map editor, so I either need to....
1) somehow get a new map texture added to the world map with the map editor so I can use my own BRF file
2) ship a new materials.brf with my mod and not use the one from the native game

I'd prefer option #1, so if anybody has been able to successfully add a new map texture please let me know.  octoburn, thank you very much for posting this question and causing me to review this!
 
octoburn:
On a map any texture that does not work correctly, becomes fully transparent. Just change shaders to some obscure ones and see. Most of them do not work on the map :smile:

If you want partially transparent texture, map_shader gets transparency data from alpha channel. Hence DXT5 and voila. Correct transparency rendering also depends on rendering order.

Hokie:
What do you mean by new map texture? Map editor loads predefined set of textures to work with, namely plain, map_steppe, ocean, mountain, snow, desert, shore, ground1 (all those .dds ofc) and does not pay attention to what you set as map textures in your materials. It does pay attention to your mod texture folder though. I personally don't have problems with map editor displaying things differently, as long as I know how it looks like in game. And yes, I changed pretty much every map texture here and there, except map icons stuff


 
HokieBT 说:
octoburn 说:
what shader did you use?

oh, good question, thank you very much!  You made me realize a few problems with my earlier test...

- I had accidentally compressed my transparent map file with DX1 compression, which I don't think works as transparency in M&B, so that is why it was probably black.  Here's a link to an uncompressed transparent texture....
http://rapidshare.com/files/159345234/map_steppe.dds.html

- I had just named this file, map_steppe.dds, and placed it in the textures folder so it just replaced the native texture and used the material in the BRF from the native game.  However, materials.brf uses "map_shader" which apparently doesn't work with transparency. So when I edited the native materials.brf file and switched the shader to "simple_shader" I got the following, holy crap!
<clip>
I will definitely have to play around with this concept more.  The only issue is i've never been able to successfully add a new map texture into the map editor, so I either need to....
1) somehow get a new map texture added to the world map with the map editor so I can use my own BRF file
2) ship a new materials.brf with my mod and not use the one from the native game

I'd prefer option #1, so if anybody has been able to successfully add a new map texture please let me know.  octoburn, thank you very much for posting this question and causing me to review this!

thanks. that should be exactly what I need.

option #2 is actually very simple. all you have to do is put the new materials.brf into your mod Resource folder and change one line in module.ini

change this

"load_resource = materials"

to

"load_mod_resource = materials"

EDIT:

okay, it works pretty good. I get basically the same result as you do, except when the camera's at a low angle, then it becomes less transparent.

bird's eye view:


low angle:


I'm not sure myself what's causing it to become less transparent and more white, but I'll keep messing with it and post if I figure anything out.
 
hmm.  Not sure why your texture became less transparent, the only thing I have seen is day/light on the world map causes it to get darker/lighter so maybe the time of day was different?

Are you editing the native materials.brf or one under your mod's folder?  I'm having trouble figuring out how I could release a mod with a transparent map texture.... 

- Currently my map is 100% the "steppe" texture and I have a transparent 'map_steppe.dds' placed in my mod's textures folder
- If I edit my CommonRes\materials.brf to have the shader as 'simple_shader' it works fine and the map is transparent
- If I edit my module.ini so it does not load the native materials.brf and instead loads a materials_new.brf I copied under my mod's folder the following happens:



My guess is the game is having a problem trying to use a material & texture from the module folder and a mesh from the CommonRes folder?  I've been trying to find out if there is a map_steppe or steppe mesh in one of the native BRF files but I've been unable to find it so far.  If I can find it maybe I can copy that to my module folder and not have the native one loaded and that would fix the issue?

my other option is to somehow add a new map texture, ie. map_transparent.dds, using the map editor.  It says you can import new terrain data by placing it under the 'editorData\MapData' folder but I have been unable to get this to work so far....  This would probably be the best option since I wouldn't have to copy and edit native BRF files when I release my mod...  If anybody has some suggestions it would be appreciated.
 
octoburn
I'm not sure myself what's causing it to become less transparent and more white, but I'll keep messing with it and post if I figure anything out.
Switch on "No fog" and "No lighting" (first 2 in a list) flags in materials both for your transparent map terrain material and all skyboxes. By hex-editing materials.brf, as BRFeditor can't do it atm. Problem almost solved. To solve it completely you need to switch off sun light, as it lightens up some part of skybox too. Search in HDR thread, somebody messed up with sunlight somewhat there AFAIR

bits and pieces on the texture are just pieces of original desert not alphaed away, left for testing
HokieBT
You messed up something in materials.brf big time. I tried and put together transparent map w/o those problems and with minimum editing:
- copy native materials.brf to your module resource folder and replace "load_resourse materials.brf" with  "load_mod_resourse materials.brf" in module.ini
- copy map_steppe.dds to your module textures with black alpha channel (or any other texture that you assigned to map_steppe material)
- switch off same flags, mentioned above
(DX9 + pixel shaders on ofc)

Also, there is no map tile related meshes in brfs, as map tiles are not fixed meshes themselves, and only materials exist for them. You can't add new map tile textures, just modify existing ones by modifying predefined set of materials, that are related to map tiles. Those starting with map_ocean and down to map_snow.
 
thanks for the tips :smile:  I'll give it a shot and see what happens.

isn't skybox_clouds_1 the onlyone used for the map?

also, I've been able to edit the material flags in BRFEdit by typing in the numbers and clicking select. the "tick boxes" don't work for me either, but this seems to work, so long as you know what numbers to put in.

EDIT:

HokieBT 说:
Are you editing the native materials.brf or one under your mod's folder?  I'm having trouble figuring out how I could release a mod with a transparent map texture.... 
all you have to do is edit the native "materials.brf" and save it in your module's resource folder as "materials" you don't have to change the name.
then, replace the "load_resource = materials" with "load_mod_resource = materials"
simple as that.
 
FYI - GetAssista helped me out, I was commenting out load_resources = materials, and putting a new load_mod_resources = materials_new at the bottom of my module.ini.  Well apparently there is an order that BRF files need to be loaded in, because it didn't like that.  Once I switched it to be back at the top of the file it worked well.  I think skybox_clouds_1 is the only one that is used for the world map, thats what I switched.
 
octoburn 说:
also, I've been able to edit the material flags in BRFEdit by typing in the numbers and clicking select. the "tick boxes" don't work for me either, but this seems to work, so long as you know what numbers to put in.
Would be cool, but does not work for me :sad:
 
后退
顶部 底部