Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TRE explorer issue with modding pixel shaders
#1
After conducting a quick experiment using Timbab's method I have managed to successfully make a small shader modification.

(I was going to attach a pic but the forums won't accept a png; Is that intentional?)

However there was an issue when modifying the PSH with the new code. When copying the hex codes from HxD or XVI32 I found that Tre Explorer continually thought I was attempting to paste the codes in text form not hex form, so 00 02 would be placed in text generating 30 30 20 30 32 in hex. This forced me to manually write in the entirety of the shader in hex form; This shader mod was only 148 bytes so that wasn't a big problem, but larger, kilobyte-sized shaders and such will make it impractical and rather time consuming to manually type in all the hex codes. Does anyone know if there is a work around?
[Image: RebelFactionStanding.png]
 
Reply
#2
Hmm!

If I remember correctly, I just copy pasted (if I'd modify) the shader from TRE Explorer's hex directly into notepad/.cpp compiler (doesn't really matter) or something, do my changes there, then paste it on top again and it should have almost fitting format. The only thing for me that I had to change, as I wrote in the guide, was the starting bit, I didn't even have to change it, rather remove the extra.

I never wrote anything in a hex or whatever.


Edit:

Actually, no I think if you try to modify anything, you need to recompile it completely, so follow all my steps it should work. I included the compiler anyway, so it should be a problem.

Sorry, totally haven't looked at this stuff in some time now, I'll figure it out once I have time later this week, flyin to the US in less than 23 hours, still gotta get some stuff done here irl.

P.S. Glad someone is toying around with it. Big Grin
 
Reply
#3
I did follow your guide but when it came to pasting the shader code back into the PEXE node of the PSH file that is where the problem began. I don't know if directly compiling the new shader then placing that in-game without utilizing the PSH/PEXE node frontend will work, and as I said before TRE Explorer will not let me paste the HEX code of the shader obtained from HxD.
[Image: RebelFactionStanding.png]
 
Reply
#4
Sorry, I haven't slept in like a week and my minds occupied with all kinds of stupid shit right now, I'll try to help you get it to work once I settle down in the next few days.

Just to double check, your process is like:

1). Raw code in whatever file, let's take a .cpp for example. Doesn't matter if it's copied or not.
2). Compile Code successfully
3.) Open code in a hex program (I just used visual studio I think), copy code, paste it into node?

Try something else than HxD and make sure you copy the hex and not the text, if that's even possible, my minds so off right now.
 
Reply
#5
http://modthegalaxy.com/downloads/uli/Exe/Combinder.zip

"Usage is -psrc <Pixel Shader Source Code> -pexe <Compiled Pixel Shader> -out <Output File>"

Basicly use the bat file or console, so:
combinder -psrc "2dblur.cpp" -pexe "2dblur.psh" -out "final.psh"

Will combine the source and compiled psh from DirectX and add all the FORM's etc.
Would post the source code but its extremely messy, if I neaten some parts up then I will but don't imagine I would unless it needs to be altered to accommodate "special" cases
[Image: 2156b479.gif]
 
Reply
#6
Am I just seeing shit due to my utter and extreme lack of sleep, or is that pretty much a slightly altered ( like request text changed) carbon copy of what I uploaded in my guide (that he read) found here:

http://www.modthegalaxy.com/forums/threa...haders-psh

Lol.

You even used the same file names for the example.

Tsk, tsk.

Anyway, lol, cya'll in a couple of days.
 
Reply
#7
(2013-01-09, 04:27 AM)Timbab Wrote: Sorry, I haven't slept in like a week and my minds occupied with all kinds of stupid shit right now, I'll try to help you get it to work once I settle down in the next few days.

Just to double check, your process is like:

1). Raw code in whatever file, let's take a .cpp for example. Doesn't matter if it's copied or not.
2). Compile Code successfully
3.) Open code in a hex program (I just used visual studio I think), copy code, paste it into node?

Try something else than HxD and make sure you copy the hex and not the text, if that's even possible, my minds so off right now.

I tried that with both HxD and XVI32. Both times I copied the hex code directly and TRE Explorer assumed I was trying to input text (which I could not persuade it otherwise).

On the other hand, I managed to circumvent the problem by opening the PSH file in HxD, searching for the PEXE node and directly pasting in the shader code after the node header, bypassing TRE Explorer entirely.

(2013-01-09, 07:12 AM)Timbab Wrote: Am I just seeing shit due to my utter and extreme lack of sleep, or is that pretty much a slightly altered ( like request text changed) carbon copy of what I uploaded in my guide (that he read) found here:

http://www.modthegalaxy.com/forums/threa...haders-psh

Lol.

You even used the same file names for the example.

Tsk, tsk.

Anyway, lol, cya'll in a couple of days.

No it's not; You uploaded the HLSL compiler plus a batch file that compiles the shaders into bytecode.

He uploaded a app that will move the new bytecode into a PSH file with appropriate SRC and PEXE forms.
[Image: RebelFactionStanding.png]
 
Reply
#8
(2013-01-09, 07:12 AM)Timbab Wrote: Am I just seeing shit due to my utter and extreme lack of sleep, or is that pretty much a slightly altered ( like request text changed) carbon copy of what I uploaded in my guide (that he read) found here:

http://www.modthegalaxy.com/forums/threa...haders-psh

Lol.

You even used the same file names for the example.

Tsk, tsk.

Anyway, lol, cya'll in a couple of days.

You derp, was just a small program to do the combinding of source and compiled output from DirectX without having to copy paste stuff about.

Its not my fault that blur shader is the the one at the top of the pixel shaders so I extracted it and worked with it.

Took me like 15 minutes to write it last night.

Edit: Also I'm the one who directed you to the whole DirectX stuff to compile it to bytecode.
[Image: 2156b479.gif]
 
Reply
#9
I was totally overtired when I posted that and at first gimps it looked like a direct rename. That said, some credit would have been nice since I basically had to figure it out all my own, you just gave me the direction where to look for the compiler. All your program is doing, is automating my crap.

So excuse dat hostility.

Edit: Correction, I just remember Sytner actually helped get me to the point of .psh compiling.
 
Reply
  



Forum Jump:


Browsing: 1 Guest(s)