Own Shader

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
noMatt
2nd Lieutenant
2nd Lieutenant
Posts: 398
Joined: Sun Mar 10, 2013 12:30 pm
Projects :: The Map has no name so see alpha
Games I'm Playing :: Crysis Battlefront
xbox live or psn: No gamertag set
Location: Germaneeee
Contact:

Own Shader

Post 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
Last edited by noMatt on Tue Apr 23, 2013 8:27 am, edited 1 time in total.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Own Shader

Post by Teancum »

What exactly do you want to do?
noMatt
2nd Lieutenant
2nd Lieutenant
Posts: 398
Joined: Sun Mar 10, 2013 12:30 pm
Projects :: The Map has no name so see alpha
Games I'm Playing :: Crysis Battlefront
xbox live or psn: No gamertag set
Location: Germaneeee
Contact:

Re: Own Shader

Post 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
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Own Shader

Post 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
noMatt
2nd Lieutenant
2nd Lieutenant
Posts: 398
Joined: Sun Mar 10, 2013 12:30 pm
Projects :: The Map has no name so see alpha
Games I'm Playing :: Crysis Battlefront
xbox live or psn: No gamertag set
Location: Germaneeee
Contact:

Re: Own Shader

Post 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
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Own Shader

Post by Marth8880 »

Right. Except only really they know how to do it, so you'd have to ask them. :p
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Own Shader

Post 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?
noMatt
2nd Lieutenant
2nd Lieutenant
Posts: 398
Joined: Sun Mar 10, 2013 12:30 pm
Projects :: The Map has no name so see alpha
Games I'm Playing :: Crysis Battlefront
xbox live or psn: No gamertag set
Location: Germaneeee
Contact:

Re: Own Shader

Post 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.
User avatar
Teancum
Jedi Admin
Jedi Admin
Posts: 11080
Joined: Wed Sep 07, 2005 11:42 pm
Projects :: No Mod project currently.
Games I'm Playing :: Destiny
xbox live or psn: No gamertag set
Location: Indiana

Re: Own Shader

Post 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.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Own Shader

Post 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.
User avatar
AceMastermind
Gametoast Staff
Gametoast Staff
Posts: 3285
Joined: Mon Aug 21, 2006 6:23 am
Contact:

Re: Own Shader

Post 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.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Own Shader

Post 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:
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Own Shader

Post 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.
noMatt
2nd Lieutenant
2nd Lieutenant
Posts: 398
Joined: Sun Mar 10, 2013 12:30 pm
Projects :: The Map has no name so see alpha
Games I'm Playing :: Crysis Battlefront
xbox live or psn: No gamertag set
Location: Germaneeee
Contact:

Re: Own Shader

Post 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??)
THEWULFMAN
Space Ranger
Posts: 5557
Joined: Tue Aug 17, 2010 3:30 pm
Projects :: Evolved 2
Location: Columbus, Ohio
Contact:

Re: Own Shader

Post by THEWULFMAN »

Speaking from limited experience, no. Maybe not impossible, I'm not educated with shaders enough, but from what I understand, no.
noMatt
2nd Lieutenant
2nd Lieutenant
Posts: 398
Joined: Sun Mar 10, 2013 12:30 pm
Projects :: The Map has no name so see alpha
Games I'm Playing :: Crysis Battlefront
xbox live or psn: No gamertag set
Location: Germaneeee
Contact:

Re: Own Shader

Post by noMatt »

:( Okay, thanks.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Own Shader

Post 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.
Post Reply