improve automatic shader application

Posted By: darkinferno

improve automatic shader application - 01/23/10 00:24

[ok]
applying shaders in WED, good idea but not really helpful for huge projects with big levels, it'd be annoying to have to click on every model and assign shaders so i do think the auto assigning via d3d_automaterial is good..

[however]
currently setting this to 1/2 and i'd have to write a material for almost every texture in the game, this is also another time consuming act plus the 15 character limit is a pain, this feature may seem ok as it is for small scenes but when it comes to a decent level with shaders on every surface then it shows just how much it could be improved.

[what am suggesting is]
i do wish there was a way i could edit some core files on how it reads the names so it'd assign materials based on for example the first 3 letters, this way i could just define some global materials that could be shared, so i could have:

SM_wall1.tga //specular metal
SW_wall1.tga //specular wall
BC_wall1.tga //bumped concrete

the i could have:

MATERIAL* SM_ ={...} //assign shader to all textures starting with SM_
MATERIAL* SW_ ={...}//assign shader to all textures starting with SW_
MATERIAL* BC_ ={...}//assign shader to all textures starting with BC_

i dont know if it can be done like that with the current system, could i edit a file? i may have to edit some core files but it'd make level creating easy because then all we'd have to do is name our textures correctly before assigning them and every map we make would automatically have shaders applied easily.. think its plausible?

for example, every element in the following screenshots has a shader applied, the two options we have now:
-click on each object and apply shaders manually which may cause problems when an object has more than one material
-write a material for every single texture in your level while making sure that the name limit of that texture plus "_nm" is under 15 characters


Posted By: BoH_Havoc

Re: improve automatic shader application - 01/23/10 00:42

while on the topic:
If you apply a shader to a block, and don't set it's FLAT flag, there is a huge fps drop. On the other hand, if you apply the shader through d3d_automaterial, there is no big hit on the fps.
Don't know if it's possible, but maybe add a new flag between FLAT and SHADED, where you can apply shaders without a big fps drop AND get the lightmaps? laugh

I also like darkinferno's idea a lot. Defining texture catchphrases like he mentioned and then automatically applying shaders to the corresponding textures sounds nice. Also the 15 characters limit is a little anoying, but i guess this is because of performance reasons?

regards
Posted By: Matt_Coles

Re: improve automatic shader application - 01/23/10 08:46

I completely agree with everything mentioned. The character limit is a big pain and the d3d_automaterial 1/2 can be painfully slow
Posted By: Zapan@work

Re: improve automatic shader application - 01/23/10 16:19

Maybe a dialog/plugin for wed would be greate. We've created a standalone tool sometime ago, which reads the wmp file and creates a wdl file (for our glider game) with the material defs for each textures wich gets assigned. This works very well, but the engine/shaders (a5/a6) were very slow during this time so we droped it... maybe until now laugh
Posted By: Matt_Coles

Re: improve automatic shader application - 01/24/10 05:35

hmm that's an interesting idea, and would save the bloated wait for d3d_automaterial to do it's thing.
Posted By: jcl

Re: improve automatic shader application - 01/25/10 07:49

As to the first problem, I agree there should be an easier way, but I don't like to control this with names. How about the following solution, switched on with d3d_automaterial: When you assign a material to a certain texture, it's automatically assigned to all blocks with this texture in the level. This won't cause a loading delay.

As to the second problem, I have to disclaim the rumor that you can get "fps drop" when applying shaders directly. Shaders are little programs on the 3D card that don't care about how they were applied. When you get an fps drop, there's something wrong, maybe with the shader, or with the level.
Posted By: darkinferno

Re: improve automatic shader application - 01/25/10 12:39

yes jcl, that feature added to d3d_automaterial sounds rather good also, i could definately also work with thatm i still like the name idea though since then we wouldnt have to be navigating the world and applying materials but oh well.. your suggestion also sounds good
Posted By: Quad

Re: improve automatic shader application - 01/25/10 12:43

beta page says it's already implemented on coming up version wink that was fast.
Posted By: BoH_Havoc

Re: improve automatic shader application - 01/26/10 01:28

Quote:
As to the second problem, I have to disclaim the rumor that you can get "fps drop" when applying shaders directly. Shaders are little programs on the 3D card that don't care about how they were applied. When you get an fps drop, there's something wrong, maybe with the shader, or with the level.


Just tried it (again...).
Applying shader through d3d_automaterial = 1 => ~180-200fps
Applying shader through WED => 6-23 fps

Tried with my own shaders as well as some of the ones which come with A7.

But as it's just a rumor i guess i'm just hallucinating the fps drop, as well as the other users who have the exact same problem.
Well, i like d3d_automaterial better anyway as you don't have to rebuild the level each time. Just thought it would be a nice feature to have. wink
Posted By: darkinferno

Re: improve automatic shader application - 01/26/10 02:24

ya, seems i'll still stick to d3d_automaterial=1, i too experinced fps drop, whether its a shader/engine error, idk but either way, using a string is still alot fast plus my update_textures function always crashes...
Posted By: jcl

Re: improve automatic shader application - 01/26/10 07:38

BoH_Havoc: I can not reproduce any fps difference dependent on which way shaders are applied. Can you contact Support and send them that project? They'll look into it.


Posted By: BoH_Havoc

Re: improve automatic shader application - 01/26/10 13:21

Alrighty, will do that laugh
© 2024 lite-C Forums