Page 2 of 5 FirstFirst 1 2 3 4 ... LastLast
Results 11 to 20 of 43

Thread: UserTool - OpenSauce command line tool

  1. #11
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,186

    Re: UserTool - OpenSauce command line tool

    I redid a number of vertex shaders in hlsl. I have yet to figure out how pixel shaders will work (mainly because scythe didn't redo any one that takes more than 5 sasm lines :P) these may be all the ones that I rewrote however I don't think so.... Anyways; here:

    convolution:

    //--vs_2_0--//

    float4 Unknown_c13 : register(c13);
    float4 Unknown_c14 : register(c14);
    float4 Unknown_c15 : register(c15);
    float4 Unknown_c16 : register(c16);
    float4 Unknown_c17 : register(c17);
    float4 Unknown_c18 : register(c18);
    float4 Unknown_c19 : register(c19);
    float4 Unknown_c20 : register(c20);

    struct vs_in
    {
    float4 Position : POSITION;
    float4 texcoord : TEXCOORD0;
    float4 color : COLOR;
    };

    struct vs_out
    {
    float4 Position : POSITION ;
    float4 Tex0 : TEXCOORD0 ; // TILING, WOMAN.
    float4 Tex1 : TEXCOORD1 ;
    float4 Tex2 : TEXCOORD2 ;
    float4 Tex3 : TEXCOORD3 ;
    };


    void main(in vs_in IN, out vs_out OUT)
    {
    OUT.Position = IN.Position; //^^^^^
    OUT.Tex0.x = 2 * mul(IN.texcoord, Unknown_c13); //waves- shift makes it look like it's waving as in real water
    OUT.Tex0.y = 4 * mul(IN.texcoord, Unknown_c14); //water
    OUT.Tex1.x = 5 * mul(IN.texcoord, Unknown_c15); //water
    OUT.Tex1.y = 5 *mul(IN.texcoord, Unknown_c16); //water
    OUT.Tex2.x = 1.4 * mul(IN.texcoord, Unknown_c17); //not water?
    OUT.Tex2.y = 2 * mul(IN.texcoord, Unknown_c18);
    OUT.Tex3.x = 1.35 * mul(IN.texcoord, Unknown_c19);
    OUT.Tex3.y = 1.25 * mul(IN.texcoord, Unknown_c20);
    };


    // vs_1_1
    // dcl_position v0
    // dcl_texcoord v4
    // dcl_color v9
    // mov oPos, v0 //^^^^^
    // dp4 oT0.x, v4, c13
    // dp4 oT0.y, v4, c14
    // dp4 oT1.x, v4, c15
    // dp4 oT1.y, v4, c16
    // dp4 oT2.x, v4, c17
    // dp4 oT2.y, v4, c18
    // dp4 oT3.x, v4, c19
    // dp4 oT3.y, v4, c20
    // approximately 9 instruction slots used


    My re-written one does some modifications to make water more visually pleasing. Try it out in Beavercreek.

    decal.hlsl:


    //--vs_2_0--//

    float4x4 WorldViewProjection : register(c0);
    float4 Unknown_c6 : register(c6);
    float4 Unknown_c9 : register(c9);
    float4 Unknown_c10 : register(c10);

    struct vs_in
    {
    float4 Position : POSITION;
    float4 color : COLOR;
    };

    struct vs_out
    {
    float4 Tex0 : TEXCOORD0;
    float4 Dif0 : COLOR;
    float4 Position : POSITION;
    };

    void main (in vs_in IN, out vs_out OUT)
    {
    OUT = (vs_out)0;
    OUT.Position = mul(IN.Position, WorldViewProjection);
    OUT.Tex0.xy = IN.color;
    OUT.Dif0 = Unknown_c10;
    float3 temp_r8;
    temp_r8.z = mul(IN.Position, Unknown_c6);
    temp_r8.z -= IN.color.w;
    temp_r8.z *= Unknown_c9.x;
    }


    // vs_1_1
    // dcl_position v0
    // dcl_color v4
    // dp4 oPos.x, v0, c0 //
    // dp4 oPos.y, v0, c1 //
    // dp4 oPos.z, v0, c2 //
    // dp4 oPos.w, v0, c3 //
    // mov oT0.xy, v4
    // mov oD0, c10
    // dp4 r8.z, v0, c6
    // min r8.z, r8.z, v4.w
    // mul r8.z, r8.z, c9.x
    // approximately 10 instruction slots used


    environment_fog.hlsl- I'm not 100% sure I rewrote this one. I think I did though. If not, scythe let me know lol!


    float4x4 WorldViewProjection : register(c0);
    float4 Unknown_c6 : register(c6);
    float4 Unknown_c7 : register(c7);
    float4 Unknown_c8 : register(c8);

    struct vs_in
    {
    float4 position : POSITION;
    float4 normal : NORMAL0;
    float4 binormal : BINORMAL0;
    float4 texcoord : TEXCOORD0;
    float4 tangent : TANGENT0;

    };

    struct vs_out
    {
    float4 Position : POSITION;
    float4 Tex0 : TEXCOORD0;
    float4 Tex1 : TEXCOORD1;
    };

    void main(in vs_in IN, out vs_out OUT)
    {
    OUT.Position = mul(IN.position, WorldViewProjection);
    OUT.Tex0.x = mul(IN.position, Unknown_c6);
    OUT.Tex0.y = IN.texcoord.z;
    OUT.Tex1.y = mul(IN.position, Unknown_c7);
    OUT.Tex1.x = mul(IN.position, Unknown_c8);
    }


    // vs_1_1
    // dcl_position v0
    // dcl_normal v1
    // dcl_binormal v2
    // dcl_tangent v3
    // dcl_texcoord v4
    // dp4 oPos.x, v0, c0
    // dp4 oPos.y, v0, c1
    // dp4 oPos.z, v0, c2
    // dp4 oPos.w, v0, c3
    // dp4 oT0.x, v0, c6
    // mov oT0.y, v4.z
    // dp4 oT1.y, v0, c7
    // dp4 oT1.x, v0, c8

    // approximately 8 instruction slots used



    lens_flare.hlsl


    //--vs_2_0--//

    float4x4 WorldViewProjection : register(c13);
    float4 Unknown_c18 : register(c18);

    struct vs_in
    {
    float4 Position : POSITION;
    float2 texcoord : TEXCOORD0;
    float4 color : COLOR;
    };

    struct vs_out
    {
    float4 Position : POSITION;
    float4 Tex0 : TEXCOORD0;
    float4 Diff : COLOR0;
    float4 Spec : COLOR1;
    };

    void main(in vs_in IN, out vs_out OUT)
    {
    OUT = (vs_out)0;
    OUT.Position = mul(IN.Position, WorldViewProjection);
    OUT.Tex0.xy = IN.texcoord;
    OUT.Diff = IN.color;
    OUT.Spec.w = Unknown_c18.x;
    }
    // vs_1_1
    // dcl_position v0
    // dcl_texcoord v4
    // dcl_color v9
    // dp4 oPos.x, v0, c13
    // dp4 oPos.y, v0, c14
    // dp4 oPos.z, v0, c15
    // dp4 oPos.w, v0, c16
    // mov oT0.xy, v4
    // mov oD0, v9
    // mov oD1.w, c18.x

    // approximately 7 instruction slots used


    If someone figures out what those registers are holding, by all means, let us know as for now I'm just shooting in the dark trying to fish out what they do.


    Add each one individually and compile with usertool.
    Reply With Quote

  2. #12
    Kid in the Hall Kornman00's Avatar
    Join Date
    Sep 2006
    Location
    ◕‿◕, ┌( ಠ_ಠ)┘
    Posts
    3,126

    Re: UserTool - OpenSauce command line tool

    Halo1 Mac and Stubbs the Zombie Mac/Xbox have the source shaders included in the install. Looking at Hal1 Mac's VSH sources would probably help. I'm not sure if I would be allowed to post them or not
    Reply With Quote

  3. #13
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,186

    Re: UserTool - OpenSauce command line tool

    Quote Originally Posted by Kornman00 View Post
    Halo1 Mac and Stubbs the Zombie Mac/Xbox have the source shaders included in the install. Looking at Hal1 Mac's VSH sources would probably help. I'm not sure if I would be allowed to post them or not
    I don't think that the devs would care... my main problem is figuring out what values are being held in the registers anyways.

    Last night because I was bored doing homework I took turns doing the water reflection shader and Pre-Cal I did transparent_water_reflection. Gives the water a neat effect as-is however removing my modifications makes it look normal so dun u worry that hlsl screwed it up.

    I also tried the shader changes in Revelations, and the water looks p. cool, hope ya'll like:

    shader_transparent_water_reflection.hlsl:


    //--vs_2_0--//
    float4x4 WorldViewProjection : register(c0);
    float4 Unknown_c4 : register(c4);
    float4 Unknown_c6 : register(c6);
    float4 Unknown_c10 : register(c10);

    struct vs_in
    {
    // dcl_position v0 //
    float4 position : POSITION;
    // dcl_normal v1 //
    float4 normal : NORMAL0;
    // dcl_binormal v2 //
    float4 binormal : BINORMAL0;
    // dcl_tangent v3 //
    float4 tangent : TANGENT0;
    // dcl_texcoord v4 //
    float4 texcoord : TEXCOORD0;
    };
    struct vs_out
    {
    float4 position : POSITION;
    float4 Tex0 : TEXCOORD0;
    float4 Tex1 : TEXCOORD1;
    float4 Tex2 : TEXCOORD2;
    float4 Tex3 : TEXCOORD3;
    float Fog : FOG;
    };
    void main(in vs_in IN, out vs_out OUT)
    {
    float3 temp_r5;
    float3 temp_r8;
    temp_r5.xyz = -IN.position + Unknown_c4;
    OUT.position = mul(IN.position, WorldViewProjection);

    OUT.Tex0 = IN.texcoord * Unknown_c10.xyyy + Unknown_c10.zwww;

    OUT.Tex1.x = IN.tangent.x; //v3
    OUT.Tex1.y = IN.binormal.x; //v2
    OUT.Tex1.z = IN.normal.x; //v1

    OUT.Tex2.x = IN.tangent.y; //v3
    OUT.Tex2.y = IN.binormal.y; //v2
    OUT.Tex2.z = IN.normal.y; //v1

    OUT.Tex3.x = IN.tangent.z;
    OUT.Tex3.y = IN.binormal.z;
    OUT.Tex3.z = IN.normal.z;

    OUT.Tex1.w = temp_r5.x;
    OUT.Tex2.w = 0 * temp_r5.y; //Nulls effect to isolate what each does
    OUT.Tex3.w = 0 * temp_r5.z; //If you want it to look normal, remove the multiplication

    temp_r8.z = mul(IN.position, Unknown_c6);
    OUT.Fog = IN.texcoord.w - temp_r8.z;
    }


    // add r5.xyz, -v0, c4
    // dp4 oPos.x, v0, c0
    // dp4 oPos.y, v0, c1
    // dp4 oPos.z, v0, c2
    // dp4 oPos.w, v0, c3
    // mad oT0.xy, v4, c10.xyyy, c10.zwww
    // mov oT1.x, v3.x
    // mov oT1.y, v2.x
    // mov oT1.z, v1.x
    // mov oT2.x, v3.y
    // mov oT2.y, v2.y
    // mov oT2.z, v1.y
    // mov oT3.x, v3.z
    // mov oT3.y, v2.z
    // mov oT3.z, v1.z
    // mov oT1.w, r5.x
    // mov oT2.w, r5.y
    // mov oT3.w, r5.z
    // dp4 r8.z, v0, c6
    // add oFog, v4.w, -r8.z
    // approximately 20 instruction slots used
    Reply With Quote

  4. #14
    Kid in the Hall Kornman00's Avatar
    Join Date
    Sep 2006
    Location
    ◕‿◕, ┌( ಠ_ಠ)┘
    Posts
    3,126

    Re: UserTool - OpenSauce command line tool

    I just ate a vanilla caramel drumstick

    was orgasmic
    Attached Files
    Reply With Quote

  5. #15
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,186

    Re: UserTool - OpenSauce command line tool

    Quote Originally Posted by Kornman00 View Post
    I just ate a vanilla caramel drumstick

    was orgasmic
    I love you like a brother Kornman.
    Reply With Quote

  6. #16
    Kid in the Hall Kornman00's Avatar
    Join Date
    Sep 2006
    Location
    ◕‿◕, ┌( ಠ_ಠ)┘
    Posts
    3,126

    Re: UserTool - OpenSauce command line tool

    And I love you like a mother...


    Dwood
    Reply With Quote

  7. #17
    Neanderthal Dwood's Avatar
    Join Date
    Sep 2008
    Location
    Wouldn't u like to know?
    Posts
    4,186

    Re: UserTool - OpenSauce command line tool

    Must spread rep. lol. Anyways I completely failed in my attempt to rewrite the active camo. Well it works, but it works a little... too well. The player is totally invisible.
    Reply With Quote

  8. #18
    Senior Member FireScythe's Avatar
    Join Date
    Sep 2006
    Location
    UK, England
    Posts
    321

    Re: UserTool - OpenSauce command line tool

    Thanks kornman, those shaders should provide some good insight. Just to be sure poeple know, the shaders are written for OpenGL(?) so won't directly compile with usertool, some conversion is still necessary .
    Quote Originally Posted by Dwood
    Anyways I completely failed in my attempt to rewrite the active camo. Well it works, but it works a little... too well. The player is totally invisible.
    When rewriting rigged model vertex shaders i'd advise using a map that is basically a box at point 0,0,0 as thats where the verts end up (in object space) if the skinning code and/or WVP are incorrect.
    Reply With Quote

  9. #19
    Kid in the Hall Kornman00's Avatar
    Join Date
    Sep 2006
    Location
    ◕‿◕, ┌( ಠ_ಠ)┘
    Posts
    3,126

    Re: UserTool - OpenSauce command line tool

    np

    There's also the Halo PC Beta vsh\fx shaders which I don't think changed until retail...but uhhhhh yeah. Not gonna post those ;x.
    Reply With Quote

  10. #20
    Senior Member Sasc's Avatar
    Join Date
    Nov 2007
    Posts
    102

    Re: UserTool - OpenSauce command line tool

    Quote Originally Posted by FireScythe View Post
    Update 25\02\10[*]
    • import-lightmap-uv - Replaces the lightmap UV's of a single bsp with those read from a matching obj file.

    For the lightmap UV replacement you should wait until you have completely finished your BSP as tool can create different lightmap surface arrangements each time you run lightmaps so an obj created with an older bsp might not match a newer one, and you don't want to re-uv the bsp everytime you make a change. Also, you should ONLY change the UV's as changing the mesh can break the surface ordering and will cause problems. The workflow for using this with Aether would be:

    1. Finish the BSP completely.
    2. Export lightmaps with Aether.
    3. Re-UV the lightmaps and import.
    4. Recreate your Aether project and export everything again.
    5. Do your Max/Maya lighting as normal.

    I can't guarantee every obj file format will work so if you have problems let me know.
    Do the custom lightmaps still work if the d3d9.dll is not used? Similar to how the maximum BSP increase still works without the DLL? I ask because I'd love to have custom lightmaps for a map, but I don't really want to have every user install the d3d9.dll. And I also don't want to install Boost, open sauce, and the DirectX redist just to find out that I need the DLL to use custom lightmaps.
    Reply With Quote

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •