[WIP - Project] An Attempt At HD Textures

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
It's all good. :)

Just overflew them again, I still need to "learn" them, but I think those are what I was looking for, we'll see. Gonna mess with them this weekend.

Edit:

Quick question, just so I understand this, excuse my utter noobness:

h_color2_specmap_bump.psh (I spread it out a bit so it's easier to read)
Code:
FORM...öPSHPFORM...ê0000PSRC....ps.1.1....
//-- t0 holds normal map and specular mask in alpha..
//-- t1 holds light vector (L)..
//-- t2 holds half angle vector (H)..
//-- t3 holds diffuse color map with hue mask in the alpha channel....
//-- sample normal map..tex t0....
//-- calculate u = N dot L..texm3x2pad t1, t0_bx2   ....
//-- calculate v = N dot H..
//-- looks up (u,v) in texture at stage 2..texm3x2tex t2, t0_bx2   ....
//-- sample diffuse map color..tex t3....
//-- add diffuse vertex lighting to colored dot3 lighting..mad_sat r0, t2, c[dot3LightDiffuseColor], v0....
//determine hue at pixel - lerp texture factors with texture alpha..lrp r1, t3.a, c[textureFactor2], c[textureFactor]....
//-- modulate hue against diffuse texture..mul r1, r1, t3....
//-- modulate hued texture against diffuse lighting..mul r0, r1, r0....
//-- mask specular, modulate with material specular color..mul r1, t2.a, t0.a..mul r1, r1, c[materialSpecularColor]....
//-- color with the specular dot3 color, add diffuse/texture..mad r0.rgb, r1, c[dot3LightSpecularColor],r0..+..mov r0.a, c[alphaFadeOpacity]...PEXE...¸..ÿÿB......°G......°..ä´H......°..ä´B......°..........ä°..ä ..ä...........ÿ°..ä ..ä ..........ä...ä°..........ä...ä...........ÿ°..ÿ°..........ä...ä ..........ä...ä ..ä....@......ä ÿÿ..
Doesn't // = comment? Or does //-- mean something totally different? What exactly to the points represent, just separation? If // does mean comment, are the brackets included in the comment or do they actually do something? Sorry, completely new to this, only got a mild background when it comes to this.
 

Kayliaah

Relic
Joined
Aug 30, 2010
Messages
322
Well usually // = comment, I would assume the -- are for better reading? Lol.

But please could somebody tell me WTF is going on with the Wiki?

http://wiki.modthegalaxy.com/Main_Page
http://wiki.modthegalaxy.com/Talk:Main_Page

Did some idiot troll us by removing everything and replacing it with random Germanic nonsense?
Those damn wikis are never secure, at least the username or at least IP of those who did this should be logged, but then again it's not hard to use a proxy to create a troll account.

It kinda looks like spam on the second page but I don't think regular bots could do that, and the SNAKES stuff screams troll.

There should be a way to lock the wiki to regular members or else this hell will happen again and again.


Tell me there is a backup, there is a backup right? I'm just saying, Charina did a hell of a job, it would be sad to see it gone.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Yea, that's what I thought, but then the file doesn't make much sense if it's all comments, there must be something I'm seeing wrong.

Damn, that's what Ton meant about spam. o_O

It wasn't me though, lol. The other languages are Russian and Polish, obvious bot, or random asshole.
 

Kayliaah

Relic
Joined
Aug 30, 2010
Messages
322
If Ton really saw this then why didn't he restore the content I wonder, we'll see when he gets there.


You should've acted, they're already here.
 

Uli

Moderator
Staff member
Moderator
Joined
Aug 30, 2010
Messages
208
bit info on psh and vsh.

vsh is in HLSL or asm, you can check which one at the start of the file, pretty easy to work with since you can pretty much look everything up and its all well commented. This is also compiled on runtime.

psh is the problem child, although it does have "raw code" in it like you see timbab its also precompiled, all the hex in the next node after can mean anything. It could be posting out the raw code and then the compiled bytecode of it in the next node unsure I haven't really looked into it. With it being precompiled the editing to it currently in limited until the second node of bytes are really understood.

doing // -- just makes it easier to read, sort of like an indent.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Ah, that makes more sense, thank you. But about what I showed above, is what I'm looking at just comments (//) or is that actually modifiable code? If it was, it kind of makes little sense, to me at least.

Haven't hit any problems understanding the VSH files yet though, but I'll be sure to research it more, like you said in HLSL or asm. I'll bug you again if I got more questions though. ;)

Still haven't found anything concrete about the defining on using the alpha's, just in the PSH I posted, ugh. Gonna spend more time on it tomorrow.
 

Uli

Moderator
Staff member
Moderator
Joined
Aug 30, 2010
Messages
208
Timbab said:
Ah, that makes more sense, thank you. But about what I showed above, is what I'm looking at just comments (//) or is that actually modifiable code? If it was, it kind of makes little sense, to me at least.

Haven't hit any problems understanding the VSH files yet though, but I'll be sure to research it more, like you said in HLSL or asm. I'll bug you again if I got more questions though. ;)

Still haven't found anything concrete about the defining on using the alpha's, just in the PSH I posted, ugh. Gonna spend more time on it tomorrow.
Code:
//-- t0 holds normal map and specular mask in alpha
//-- t1 holds light vector (L)
//-- t2 holds half angle vector (H)
//-- t3 holds diffuse color map with hue mask in the alpha channel
//-- sample normal map
tex t0
//-- calculate u = N dot L
texm3x2pad t1, t0_bx2
//-- calculate v = N dot H
//-- looks up (u,v) in texture at stage 2
texm3x2tex t2, t0_bx2
//-- sample diffuse map colortex t3
//-- add diffuse vertex lighting to colored dot3 lighting
mad_sat r0, t2, c[dot3LightDiffuseColor], v0
//determine hue at pixel - lerp texture factors with texture alpha
lrp r1, t3.a, c[textureFactor2], c[textureFactor]
//-- modulate hue against diffuse texture
mul r1, r1, t3
//-- modulate hued texture against diffuse lighting
mul r0, r1, r0
//-- mask specular, modulate with material specular color
mul r1, t2.a, t0.a
mul r1, r1, c[materialSpecularColor]
//-- color with the specular dot3 color, add diffuse/texture
mad r0.rgb, r1, c[dot3LightSpecularColor],r0
+
mov r0.a, c[alphaFadeOpacity]
I'm unsure about the final "+" in the second last line, I would have to take a look at the file your looking at but thats how it should read.

I think its "0D 0A" or something close in hex = new line. So anytime you see ".." normally its that hex which means new line
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Doh, I expected that '...' is separation/new line, just wasn't sure. Ty for making the structure clearer and clean. Makes much more sense now.
 

Uli

Moderator
Staff member
Moderator
Joined
Aug 30, 2010
Messages
208
Timbab said:
Doh, I expected that '...' is separation/new line, just wasn't sure. Ty for making the structure clearer and clean. Makes much more sense now.
its ps1.1 assembly in case you want to look up what the assembly means (the tex ones they are the more advanced onces) unlike the mul x,y,z

Mul x,y,z = Multiply Y and Z, Store in X
X = Y*Z

Most are simple like that some you have to look up as they may contain matrix rotations.

Will have to work out what the second node (Which I assume is the Pixel Shader Compiled) actually means so we can get something made to allow us to alter them.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
After looking around for ps1.1, I just stumbled across this (I mean at the bottom where the Shader talk is). Seems to be a more in depth look into exactly what I'm looking for, but I just overflew it, it's too late right now. I'll dig into this stuff tomorrow.

It would be really handy to have full control over those files, if you or someone else finds a way.

Edit: The link above as the only thing I could find at first, found loads more now with different search keywords.
 

wefi

Member
Joined
Jul 27, 2011
Messages
47
Kayliaah said:
Tell me there is a backup, there is a backup right? I'm just saying, Charina did a hell of a job, it would be sad to see it gone.
http://web.archive.org/web/20100905112545/http://wiki.modthegalaxy.com/Main_Page

what we used to get some of Modsource's old Guides, it should work for this too.
 

Uli

Moderator
Staff member
Moderator
Joined
Aug 30, 2010
Messages
208
The wiki should have changes for every page so its just about going to them and reverting the changes.
 

Tonberry

Inactive Staff
Joined
Aug 30, 2010
Messages
372
The content of the wiki is still there, even without reverting. The layout's just a bit screwed up now and spammed up. I don't think my account is flagged to revert the changes but I'm sure Davin will clean it out next time he's got a minute free.
 

Kayliaah

Relic
Joined
Aug 30, 2010
Messages
322
wefi said:
Kayliaah said:
Tell me there is a backup, there is a backup right? I'm just saying, Charina did a hell of a job, it would be sad to see it gone.
http://web.archive.org/web/20100905112545/http://wiki.modthegalaxy.com/Main_Page

what we used to get some of Modsource's old Guides, it should work for this too.

Yeah I searched the archives after ModSource went down, but most of the old tutorials and tricks weren't there, too bad.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Ugh, wanted to post a good update before I go on 'vacation' for a week, but my fucking PC crashed resulting in loosing around 4-5 hours of work. Fucks sake. Only did a little bit after I started it up again, but seriously had no mood to correct the extreme and utter retarded stretching on the Bicep and some other oddities after this. But, I haven't forgotten about the project, so just wanted to give a heads up. Just needed a break, I was beginning to think one dimensionally and it got me nowhere.

The .sht are being a pain in the ass by the way, they won't accept anything but minor changes, they also won't accept any 'new' files that aren't the original names. It just crashes. Haven't had a time to dig through the actual shader files yet.

I'll have my laptop with me, so I might take my pad with me too and do some work when I get the chance, away from the internet, lol, no self distractions.


Anyway, a teaser then...

Dirt work is nearly done, edges just need refining, strange warping and stretching needs to be fixed and the things in between. Had the 'emblem' already done right before the crash, but it's gone again. But yea, as you can see, the stretching is pretty fucked up (never noticed until I added dirt/metal effect), le sigh.





1, 2, 3, 4



 

Tonberry

Inactive Staff
Joined
Aug 30, 2010
Messages
372
Sexy. Nuff said. :p

No idea whats going on with your shader files though. They usually behave for me.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
It's pretty weird, for instance, if I change the .dds texture to armor_composite_helmet1.dds, or something similar, then make that change in the .sht, it crashes once it tries to 'see' the armor ingame (char select). It's pretty weird. I mean I can change the effect file for example, with out a problem, as long as the file exists in the tre files or is 'legit'. Maybe there is more to it then just the .sht to assign effect/textures? Doesn't matter though, I'll figure it out!
 

Uli

Moderator
Staff member
Moderator
Joined
Aug 30, 2010
Messages
208
Timbab said:
It's pretty weird, for instance, if I change the .dds texture to armor_composite_helmet1.dds, or something similar, then make that change in the .sht, it crashes once it tries to 'see' the armor ingame (char select). It's pretty weird. I mean I can change the effect file for example, with out a problem, as long as the file exists in the tre files or is 'legit'. Maybe there is more to it then just the .sht to assign effect/textures? Doesn't matter though, I'll figure it out!
If it crashes there is probably an error somewhere in the mod, there isn't much in shaders there are a few unknowns but those unknowns shouldn't crash you.

Make sure your not overwriting any NULL terminators and that you are using TRE Explorer not a regular hex editor (Form headers contain how big they are so in normal hex editors it screws up the read size).
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Not using the TRE Explorer to edit must be the problem then, ty I'll try it out asap. :)

I mean it seems pretty straight forward and I know did it right, technique wise, which made me confused.
 

Kayliaah

Relic
Joined
Aug 30, 2010
Messages
322
What a noodle, why would you use a random hex editor when TRE Explorer basically does the work for you. :p

Get Uli's fixed TRE Explorer from there, it's cleaner and a lot faster.
 
Top Bottom