Page 1 of 1

Own Shader

Posted: Tue Mar 19, 2013 5:56 pm
by noMatt
Hey guys i wanna know if it is possible to write an own shader.

So if someone did this before and is able to tell me how, it would be very cool if he do so

Re: Own Shader

Posted: Tue Mar 19, 2013 7:28 pm
by Teancum
What exactly do you want to do?

Re: Own Shader

Posted: Thu Mar 21, 2013 4:14 pm
by noMatt
Writin an own shader. Or for everyone who is not a "hobby Programmer"

The shader is a programm that'll be run on the VGA not on CPU. It is not that kind of a problem to write an own shader, and i everytime i compile a map with comon check box checked, is saw that visual munge compiles shaders too.

The shaders a locatet in BF2_ModTools\data_EAR\Common\shaders\PC.

For every type of surface ( i know thats a really bad translation but since my english is not that good... I hope it is understandable what i wanna say) there is an own shader. So theres a water shader, a bump_shader and so on. And if we want to upgrade BF2 Grafik, this will be the code we have to rewrite (for everyone who'll try this: keep the stocked variable names, or it wont match with the code the game uses)

I dont know exactly, if this will work and since i'm not a proffesional, but rather someone who only knows the job the shaders do, i dont want to learn HLSL (High Level Shading Language) if it wont work in Battlefront

Re: Own Shader

Posted: Thu Mar 21, 2013 4:30 pm
by Marth8880
Is it possible to write your own shader for Battlefront II? Yes.
Is it possible to implement said shader(s) into aforementioned game? Yes.
Is it easy or is there any publicly-known method of implementing said shader into said game? HAHA NO LOL

Re: Own Shader

Posted: Thu Mar 21, 2013 4:34 pm
by noMatt
Yeah but i saw lots of mods (2 lol) with a "graphical Update) and the only thing done is a bit color recorrection. If anyone write an own shader the game will be completly diffrent

Re: Own Shader

Posted: Thu Mar 21, 2013 4:38 pm
by Marth8880
Right. Except only really they know how to do it, so you'd have to ask them. :p

Re: Own Shader

Posted: Thu Mar 21, 2013 5:14 pm
by Teancum
noMatt wrote:Writin an own shader. Or for everyone who is not a "hobby Programmer"
I get that. What do you want to do with your shader?

Re: Own Shader

Posted: Thu Mar 21, 2013 5:39 pm
by noMatt
Better water (I know theres no tesselation support in DX9c, but there are some nice features Pandemic didnt included, because of time reasons)

and as soon as i got the hang out how to do it, i'm sure i find some nice places to put a new shader in.

Re: Own Shader

Posted: Thu Mar 21, 2013 7:18 pm
by Teancum
It's been a long time since I took a look at them and I don't have the mod tools installed at the moment, but if I recall correctly they're a mix of XML and C++ code.

Re: Own Shader

Posted: Thu Mar 21, 2013 9:06 pm
by Marth8880
noMatt wrote:Better water (I know theres no tesselation support in DX9c, but there are some nice features Pandemic didnt included, because of time reasons)
Really? Huh. I would say the normal map shader needs the most improvement.

Re: Own Shader

Posted: Thu Mar 21, 2013 11:18 pm
by AceMastermind
Is it possible to write your own shader for Battlefront II? Yes.
Is it possible to implement said shader(s) into aforementioned game? Yes.
Sources?

The existing shaders are referenced in the game executable, i don't think you can write new ones and have the game recognize them without having source code. You may be able to modify existing ones, but I don't know anyone that has done this successfully. The graphical updates you saw in some mods were probably due to folks taking advantage of barely used material flags.

Re: Own Shader

Posted: Fri Mar 22, 2013 12:06 am
by Marth8880
Well, yeah, I meant "modify" instead of "create", but yeah. And implementing them...still not sure about "yes" or "no" - I'm pretty positive though that they're stored in the core.lvl.


Ugggh. I really want to try modifying one and stuff but I don't know what to modify that would be noticeable! :twinkeyrunaway:

Re: Own Shader

Posted: Fri Mar 22, 2013 12:29 am
by THEWULFMAN
Don't hold me to this.

You can inject new shaders by loading them alongside the exe, without editing the executable at all. This is what Battlefront 2013 is doing.

Re: Own Shader

Posted: Mon Apr 22, 2013 12:08 pm
by noMatt
My Problem is, i'm not a programmer so i'm not able to write a shader. but if someone knows that it'll work, i'll learn HLSL

EDIT
Sorry for bump this up but i have another question about that: @THEWULFMEN:
Is it possible to implement displacement mapping (or better Parralax Occlusion mapping) with this method (loading them alongside the exe??)

Re: Own Shader

Posted: Mon Apr 22, 2013 12:41 pm
by THEWULFMAN
Speaking from limited experience, no. Maybe not impossible, I'm not educated with shaders enough, but from what I understand, no.

Re: Own Shader

Posted: Mon Apr 22, 2013 1:14 pm
by noMatt
:( Okay, thanks.

Re: Own Shader

Posted: Tue Apr 23, 2013 2:26 am
by Marth8880
Possible? Probably. Legally? Lol no. (Probably actually, since modifying the exe shouldn't be necessary [but then it is Zero Engine, which would mean the freakin FL Sound Engine would probably have to be modded or something lol {do the rules of modding the exes/dlls still even apply anymore vis a vis(? sure why not) recent Disney acquisition?}]). If you have a ton of experience and you know exactly what you're doing? Maybe.