Jump to content

Lindor

Sacred Game Modder
  • Posts

    1,101
  • Joined

  • Last visited

  • Days Won

    37

Posts posted by Lindor

  1. Yee unlike the standard SURFACE_FLAG_TENERGY, the effect is responsive to the texture0Name's alpha channel. You can make it as transparent as you wish. That's something that was important to me, as I always wished that was true for SURFACE_FLAG_TENERGY.

  2. You can also make it more transparent in the add-t-energy.shader. I think I like that more :)

    alphawings.jpg.a5a85a3899960c03d2a4688e6c10eb50.jpg

        float3 color_diffuse = colorize3D(tex0.xyz + (te.color0.xyz * tex0.a));
        float3 color_glow = float3(te.color1.xyz * tex0.a);
    	
    	O.col[0] = float4(color_diffuse.xyz, tex0.a);
    	O.col[1] = float4(color_glow.xyz, tex0.a);
    
    	return O;
    }

     

    • Respect! 1
  3. Seraphim Mystique Set Wing FX Fix

    View File

    Re-enables the Seraphim's Mystique Armor Set, which e.g. Revelation of the Seraphim and Sopor Aethernis are part of, Wing FX.
    These FX somehow work on console, but not on PC. I re-enabled it for PC.

    I can strongly recommend to use this Mod's extractvalues.shader as I improved and fixed some stuff.

    Initially this mod is intended for other modding developers. If you just take the mod as is without transfering the changes, then you need EE as the surface.txt I used is based on EE's Surface.txt.

    Remember to clear your shader cache before enabling this mod or otherwise this won't work.


     

  4. This has to be the case nut I've solved so far. Instead of trying to force the game into accepting the SURFACE_FLAG_TENERGY, I searched for the function responsible for the effect and created a T-Energy shader which automatically applies the effect.

    I've had to guess which textures the game uses, though. But I think I got pretty close :D Transparent-T-Energy-Wings.jpg.9053aeaf9cca057e6967780f6392b393.jpg

    Will upload a mod again.

     

     

    I strongly recommend using the extractvalues.shader which I will provide in the mod even if you're not using the T-Energy wings. I improved it.

    Also I think it would be a good idea to change the "sera-mystique-wing_c" and "sera-sopor-wing_c" flag from SURFACE_FLAG_OPAQUE to SURFAC_FLAG_MASKED and not just focus on the "sera-mystiquefx-wing_c" / "sera-soporfx-wing_c" surfaces.

  5. In surface.txt, SURFACE_fLAG_TENERGY never appears together with SURFACE_FLAG_TRANSPARENT. Except for three instances, the SURFACE_fLAG_TENERGY always appears together with either SURFACE_FLAG_OPAQUE or SURFACE_FLAG_MASKED.
    These three instances are "fx-speicherstein_s", "sera-mystiquefx-wing_c" and "sera-soporfx-wing_c".

    The sopor aethernis wings are a variant of the mystique set, and their FX do show up, but their SURFACE_FLAG_TENERGY isn't working either.

    I find this together with your post here interesting:

    On 9/24/2022 at 11:18 PM, Vishanka said:
    ewSurface = {
      name         = "seraphim-mystiquefx-wing_c",
      texture0Name = "maps/heroes/seraphim/sets/mystique/c_sera-mystique-wing_fx_orig.tga",
      texture1Name = "maps/heroes/seraphim/sets/mystique/c_sera-mystique-wing_fx_orig.tga",
      texture2Name = "fx/blue.tga",
      flags        = SURFACE_FLAG_SFX + SURFACE_FLAG_TENERGY,
      shader       = obj_d_s_b_skin,

    HCz4ksa.png

    So the fx CAN spawn without either of the three opaque, transparent and masked flags. It's not the SURFACE_FLAG_TRANSPARENT which stops the T-Energy-effect from working. Now I'm even more confused than before. Why isn't it showing up, and why does it work on console?

     

    EDIT:

    Aaand it doesn't make any sense because the soporfx surface is functionally the same as the wingfx surface. everything's the same, it takes another diffuse image but the image's content is the same as the mystique's diffuse image. Even the itemtypes of the wings match. So why do the soporfx appear but the mystiquefx don't? It must be a hardcoded issue, then.

  6. I respect your decision. Can't say I'm too surprised. Although I must say you deserve more than a silent fade-out. Something like a farewell party ;D Your legacy is huge and will always be remembered, at least by me.

    I asked because the idea doesn't really have a point if the modders don't use the result and continue supporting future versions with their own files instead. Don't have to worry about that if there are no future versions, I guess.

    I'm probably like 10 years too late with this idea. If we take you and Dmitriy out of the equation, then there aren't many more modders left who would profit from the collaboration. Which makes me ponder wether the effort would be worth it. Hopefully Sacred 2 doesn't die.

    • Thanks! 1
  7. The alpha channel of the T-Energy-shader's color output has no effect whatsoever. The output color just gets multiplied and therefore darkened by the input texture's alpha channel.
    It seems that for the mytiquefx surface, at least one of SURFACE_FLAG_OPAQUE, SURFACE_FLAG_MASKED or SURFACE_FLAG_TRANSPARENT needs to be present or otherwise the surface doesn't get rendered. I have no idea why.

    We want solely SURFACE_FLAG_TRANSPARENT to work with T-Energy. And no matter what I try, it just doesn't work.

    So far I'm out of theories. There are multiple surfaces out there which don't have one of the three textures, dont know but I think they do work, e.g. "fx-sera-fluegel-castbase_c" or "fx-sera-kampfhaltung-cast_c". Also non-fx-surfaces like all the ancient set wing variations. Why not mystiquefx? I have no idea.

    If only I knew what shader was responsible for SURFACE_FLAG_TRANSPARENT. If only I knew why SURFACE_FLAG_TRANSPARENT even exists. Theres a C#-var calles IsOpaque which gets set to true via SURFACE_FLAG_OPAQUE. Why not have either the flg set and set alpha to 1 or have it not set and set alpha to whatever the inpt texture's alpha is? What does this flag do? Why does it need to be present for the fx to get rendered? So many questions, so little answers.

  8. 7 hours ago, Hooyaah said:

    Interesting, perhaps another, such as Lindor would understand why such amended files would cease to work when imported back in and know a work-around. Pesmontis (long time gone) is the only one I know who could work such arcane magic. The last time I looked, there were no tutorials online of value. What GR2 tool are you using?

    Thanks but forget it. I have spent decades trying to find a GR2 exporter for Blender that works with Sacred 2. There is None.

    GR2 is a game-specific format by RAD gametools. It's different for each game. They once hosted an invaluable tool called Granny Viewer, but they redirected the link some time ago.

    There are some importers/exporters for other games, namely NWN2, Divinity: Original Sin 2, Baldur's Gate 3 and Metin 2, but not Sacred 2. There is also granny3D by RADgametools which technically has an exporter, but according to Dmitriy it costs around 12k-18k USD per License.

    I have never done anything myself, just collecting links and information. I am really not in the position to say that I understand the .GR2 file format.

    @dimitrius154 and @Pesmontis are gods compared to me. There are also @Inspired and @RuDDicK, two Sacred: Underwold Modders who know a lot about this topic. AFAIK Schot is also into this. And there's also @Flix, of course.

    Here's what they did for CM patch to make modelling for Sacred 2 possible:

    • Together with Grannyviewer and Pesmontis' grnreader98 it was at least possible to import GR2 files into blender, maya or 3ds max but not export.
    • You can export from 3ds max 7, 8 or 9 using Dmitriys tools, but again a License is very expensive despite autodesk don't even selling it anymore. It has to be mentioned that Dmitriys tools contain the latest Scred 2 compatible version of Norbytes tool for Divinity: Original Sin. Dmitriys tools also contain the latest verion of grnreader98.

     

     

    One of my personal lifegoals is to someday write an Sacred 2 .GR2 importer/exporter for blender myself. A tool explicitly for Sacred 2 so that importing/exporting to/from an Open Source software like blender and enabling control over finer details is finally possible, that would be the dream. I can't even overexaggerate enough at how hard of a task that is.

     

    It has been long enough that those links I've collected are held back out of fear. I'll provide them. @gogoblender @Schot please feel free to remove anything which you think is too shady to post here.

    3DS Max:

    Granny Viewer:

    GR2 Tools:

    Additional Information / Discussions / Tutorials at Darkmatters:

    Wiki Page:

    This entire topic is such a nightmare, hopefully some day we can start a big collaboration with everyone involved on GitHub to script our own importer/exporter for Sacred 2. That would be so epic!

  9. 37 minutes ago, Vishanka said:


    newSurface = {
      name         = "sera-ancient-insulator_c",
      texture0Name = "maps/heroes/seraphim/sets/ancient/c_sera-ancient-insulator_d.tga",
      texture1Name = "maps/heroes/seraphim/sets/ancient/c_sera-ancient-insulator_sg.tga",
      texture2Name = "maps/heroes/seraphim/sets/ancient/c_sera-ancient-insulator_n.tga",
      flags        = SURFACE_FLAG_OPAQUE + SURFACE_FLAG_DOUBLESIDED,
      shader       = fx2,
    }
    mgr.surfCreate(newSurface);

    what is this? My surface.txt doesn't have this baseline

    I have no idea. Maybe I forgot to disable EE when exporting the files. The files are present in graphics26.c_sera-ancient-insulator_d.png.4dbb5075c7a16ec95683730d4486465e.png

     

    But did it work for you?

  10. Seraphim Ancient Set Wing FX for Mystique Set Wings

    View File

    This mod recreates the Seraphim's Ancient Set Wing FX, which e.g. the Endijan Set is a variation of, for the Seraphim's Mystique Set Wings, which e.g. the Revelation of the Seraphim Set is a variation of.

     

    For CM patch or PFP. Not straightly compatible with EE or Addendum, as it takes the CM patches surface.txt file.

     

    Remember to delete your shader.cache before enabling this mod or otherwise this will not work.


     

    • Like! 1
  11. 4 hours ago, Flix said:

    Yes.

    Thanks. This is wierd. Photo directly taken from the wiki:

    revelation.gif

    No Wing FX. Same as for me.

    Someone else seemed to have similar issues back in the days.

    9 hours ago, Vishanka said:

    But I think the paths are all correct, I called every file and pathname "seraphim" so there shouldn't be a problem with the name

    I will make a quick mod just for the FX and upload it to darkmatters. If it works for me but it still doesn't work for you, then we can at least exclude human error.

  12. Just noticed, the forum automatically converts “_s_e_r_a_“ (without the underscores) to “seraphim“ whenever its posted somwhere. Very annoying.

    Im sure that this is the reason. As I said, the original surface and image names have the abbreviation and not the full word in the names.

    • Like! 1
  13. I see couple of possibilities. The original revelation wing was called seraphim-mystiquefx-wing_c, not seraphim. Or maybe you have multiple surfaces named the same which overwrite each other. Or you didn't clear shader.cache before loading the game. Or something at the file convertion process went wrong, you can try to create your own image instead. Or I made a mistake when I was deleting some comments out of the shader before posting it. Or the game is just completely illogically broken.

  14. BTW I liked your lava shader solution, it was something I did not expect.

    19 minutes ago, Lindor said:

    That's quite a task. Never figured this one out.

    I like challenges :D

    I have an idea. The console hint is something valuable I can follow.

  15. 4 hours ago, Vishanka said:

    When you get the endijian thing to work and want a new challenge: The original mystique fx t-energy effect never worked. I think it works on console

    That's quite a task. Never figured this one out.

    I like challenges :D

  16. 4 hours ago, Vishanka said:

    I'll happily use your version when you're done, mine works but I think it's done very uh noobish, so I'd happily take a professional version.

    Well thanks, I just make an offer, take whatever looks good to you. My goal is just to transfer the endijan wings fx as closely as possible to the mytique wings since I figured that was what you were trying to accomplish.

    Most of the time I'm guessing theories, and sometimes they hold with the ingame results and sometimes I haveno idea.
    E.g I have no idea

    • Why T-Energy-Wings work on console, but not on desktop
    • Why the lava shader animations for your wings work with only 3 instead of 4 texture inputs
    • why SURFACE_FLAG_MASKED makes the wings fx disappear no matter what I tried
    • why any shader collections that have only the ambDiff and everything else is set to "null.shader" works only with the wings if they have SURFACE_FLAG_TRANSPARENT. Why the heck is everything invisible if you DON'T have the flag?
    • honestly: how shader collections even work in the first place, e.g. what's the difference between diffusePnt and diffusePntShd?

    So many questions, I can only guess. Most of the time I'm like you just experimenting and trying out a lot. E.g. I have 46x shader.cache in my recycle bin right now xD

    Here are my results:

    endirecre3.jpg.6693538da7b945c267f4a6321e9d0a0d.jpg

    Shader:

    Spoiler
    // effect on seraphim wings
    #include "extractvalues.shader"
    
    struct appdata {
    	float3 position    : POSITION;
    	float3 normal      : NORMAL;
    	float3 tangent     : TANGENT;
    	float3 binormal    : BINORMAL;
    	float2 texcoord    : TEXCOORD0;
    	float2 data        : TEXCOORD1;
    };
    
    struct pixdata {
    	float4 hposition   : POSITION;
    	float4 texcoord0   : TEXCOORD0;
    	float4 texcoord1   : TEXCOORD1;
    	float4 screenCoord : TEXCOORD2;
    };
    
    struct fragout {
    	float4 col[2]      : COLOR;
    };
    
    pixdata mainVS(appdata I,
      uniform float4x4 worldViewProjMatrix)
    {
    	pixdata O;
    	
    	float4 pos4 = float4(I.position, 1.0);
    	// vertex pos
    	O.hposition = mul(pos4, worldViewProjMatrix);
    	// vertex-position in screen space
        O.screenCoord = calcScreenToTexCoord(O.hposition);
    	// pass texture coords
    	O.texcoord0 = I.texcoord.xyyy;
        
        // only works for the original endijan GR2 mesh
    	//O.texcoord1 = I.data.xyyy;
    
    	return O;
    }
    
    fragout mainPS(pixdata I,
      uniform sampler2D   texture0,
      uniform sampler2D   texture1,
      uniform float4      system_data)
    {
    	fragout O;
    
        // color
            s2half4 tex0 = tex2D(texture0, I.texcoord0.xy);
    
        // move noise entry coords
            float2 noise_coords = I.texcoord0.xy;
        
        // calc plasma intensity
            // p is the y-coord at the start of the wings, at the seraphim's back. Image is 256 pixels wide, start is at pixel 95.
            float p = 95.0 / 256.0;
            // are we at the left or at the right of p?
            float l = 0.5 + ((I.texcoord0.y - p) / (2.0 * abs(I.texcoord0.y - p)));
            // linear interpolation
            float plasmacoords = 0.5 + ((I.texcoord0.y - l) / (2.0 * (p - l)));
    
        // calc noise
                float2 lup = float2(0.13, 0.13) * noise_coords;
                float2 lup1 = lup + 0.005 * system_data.xx;
                float2 lup2 = lup - 0.005 * system_data.xx;
                float4 noi1 = tex2D(texture1, lup1);
                float4 noi2 = tex2D(texture1, lup2);
            // halfspace
                float noi = abs((noi1.x + noi2.x) - 1);
            // make slimmer
                float pl = pow((1.0 - noi), 10.0 * (1.0 - plasmacoords));
    
            // pulse factor pulsing between 0.6 and 1.0
                float pulse_factor = 0.8 + 0.2 * sin(6.283185 * frac(0.35 * system_data.x));
    
        // get plasma color from tex0
            float3 plasma_col_a = pow(plasmacoords, 0.8) * pl * tex0.xyz + 2.0 * pow(plasmacoords, pulse_factor * 5.0) * tex0.xyz;
            float3 plasma_col_g = 0.5 * pow(plasmacoords, pulse_factor * 5.0) * tex0.xyz;
    	
    	O.col[0] = float4(plasma_col_a, tex0.a);
    	O.col[1] = float4(plasma_col_g, tex0.a);
    
    	return O;
    } 
    
    
    
    
    
    

     

    Shader Collection: (make sure you match the ambDiff name with whatever name you saved the shader)

    Spoiler
    obj_fx_twings_test2 = {
      diffusePnt    = "null.shader",
      diffusePntShd = "null.shader",
      z             = "null.shader",
      shadowmap     = "null.shader",
      cubeshadowmap = "null.shader",
      ambDiff       = "object/fx/seraphim-wings-fx.shader",
    }

     

    surface:

    Spoiler
    newSurface = {
      name         = "seraphim-mystiquefx-wing_c",
      texture0Name = "fx/wing_fx_test5.tga",
      texture1Name = "fx/noise.tga",
      flags        = SURFACE_FLAG_TRANSPARENT + SURFACE_FLAG_PARTICLEEMITTER,
      shader       = obj_fx_twings_test2,
    }
    mgr.surfCreate(newSurface);

     

    image: (need to convert to dds or tga)

    Spoiler

    wing_fx_test5.png.42ad100f6fc144e97002750f9dc424ee.png

     

  17. @Vishanka

    I experimented some more

    endirecre2.jpg.12d03f76d63052d539e58987640c0c4a.jpg

    new seraphim-wings-fx.shader:

    // effect on seraphim wings
    #include "extractvalues.shader"
    
    struct appdata {
    	float3 position    : POSITION;
    	float3 normal      : NORMAL;
    	float3 tangent     : TANGENT;
    	float3 binormal    : BINORMAL;
    	float2 texcoord    : TEXCOORD0;
    	float2 data        : TEXCOORD1;
    };
    
    struct pixdata {
    	float4 hposition   : POSITION;
    	float4 texcoord0   : TEXCOORD0;
    	float4 texcoord1   : TEXCOORD1;
    	float4 screenCoord : TEXCOORD2;
    };
    
    struct fragout {
    	float4 col[2]      : COLOR;
    };
    
    pixdata mainVS(appdata I,
      uniform float4x4 worldViewProjMatrix)
    {
    	pixdata O;
    	
    	float4 pos4 = float4(I.position, 1.0);
    	// vertex pos
    	O.hposition = mul(pos4, worldViewProjMatrix);
    	// vertex-position in screen space
        O.screenCoord = calcScreenToTexCoord(O.hposition);
    	// pass texture coords
    	O.texcoord0 = I.texcoord.xyyy;
    	//O.texcoord1 = I.data.xyyy;
    
    	return O;
    }
    
    fragout mainPS(pixdata I,
      uniform sampler2D   texture0,
      uniform sampler2D   texture1,
      uniform float4      system_data)
    {
    	fragout O;
    
    	// color
    	s2half4 tex0 = tex2D(texture0, I.texcoord0.xy);
    
      // move noise entry coords
      float2 noise_coords = I.texcoord0.xy;
    
      // calc noise
      float2 lup = float2(0.13, 0.13) * noise_coords;
    	float2 lup1 = lup + 0.005 * system_data.xx;
    	float2 lup2 = lup - 0.005 * system_data.xx;
    	float4 noi1 = tex2D(texture1, lup1);
    	float4 noi2 = tex2D(texture1, lup2);
    	// halfspace
    	float noi = abs((noi1.x + noi2.x) - 1);
    	// make slimmer
    	float pl = pow((1.0 - noi), 10.0 * (1.0 - I.texcoord0.y));
    
      // pulse factor pulsing between 0.6 and 1.0
      float pulse_factor = 0.8 + 0.2 * sin(6.283185 * frac(0.35 * system_data.x));
    
      // get plasma color from tex0
      float3 plasma_col_a = pow(I.texcoord0.y, 0.8) * pl * tex0.xyz + 2.0 * pow(I.texcoord0.y, pulse_factor * 5.0) * tex0.xyz;
      float3 plasma_col_g = 0.5 * pow(I.texcoord0.y, pulse_factor * 5.0) * tex0.xyz;
    	
    	O.col[0] = float4(plasma_col_a, tex0.a);
    	O.col[1] = float4(plasma_col_g, tex0.a);
    
    	return O;
    } 
    
    
    
    
    
    

    surface:

    newSurface = {
      name         = "seraphim-mystiquefx-wing_c",
      texture0Name = "fx/wing_fx_test2.tga",
      texture1Name = "fx/noise.tga",
      texture2Name = "fx/black.tga",
      flags        = SURFACE_FLAG_TRANSPARENT,
      shader       = obj_fx_twings_test,
    }
    mgr.surfCreate(newSurface);

    shader collection:

    
    obj_fx_twings_test = {
      diffusePnt    = "object/diffSpecBumpPnt.shader",
      diffusePntShd = "object/diffPntShd.shader",
      z             = "object/z.shader",
      shadowmap     = "object/shadowMap.shader",
      cubeshadowmap = "object/cubeShadowMap.shader",
      ambDiff       = "object/fx/seraphim-wings-fx.shader",
    }

    Texture (had to convert it to png to be postable, originally it's dds):

    wing_fx_test2.png.4d23d2327d8c43cb8b2e745d280a99cb.png

     

    Basically nothing changed for the endijan effect itself, I just made it so that the vertex shader calculates the correct texcoords for the new model and that the alpha channel gets applied for the effect which, for the original endijan wings, is hardcoded. Nothing more.

    I'm not quite happy with the black-ish regions yet. Have some ideas, gonna experiment some more, but I'm very close at successfully applying the endijan wings effect to the mystique set.

    • Respect! 1
  18.  @Vishanka

    Found a way to directly use the shader and image responsible for the Endijan Wings effect:
    endirecre.jpg.1ab1b6cf3aa823219e1626209e17b7b3.jpg

    At the top of the file:

    obj_fx_twings_test = {
      diffusePnt    = "object/diffSpecBumpPnt.shader",
      diffusePntShd = "object/diffPntShd.shader",
      z             = "object/z.shader",
      shadowmap     = "object/shadowMap.shader",
      cubeshadowmap = "object/cubeShadowMap.shader",
      ambDiff       = "object/fx/ambDiffTWings.shader",
    }

    The surface:

    newSurface = {
      name         = "seraphim-mystiquefx-wing_c",
      texture0Name = "maps/heroes/seraphim/sets/ancient/c_sera-ancient-wing_fx.tga",
      texture1Name = "fx/noise.tga",
      texture2Name = "fx/noise.tga",
      flags        = SURFACE_FLAG_TRANSPARENT + SURFACE_FLAG_SHELLFX + SURFACE_FLAG_SFX,
      shader       = obj_fx_twings_test,
    }
    mgr.surfCreate(newSurface);

    I like that. Gonna keep it for my mod :) You can experiment some more with the image, transparency etc., if you like. Also if you want to reduce the density, then I can do this in the shader file directly for you.

    I think these wings have some hardcoded wierdness with the alpha channel going on. That's why the glow file behaves so wierdly. Don't know wether the surface 3 looping theory holds, tried to test, some results spoke for the theory and some didn't.

    40 minutes ago, Vishanka said:

    You probably don't have the fx_frac

    Ye makes sense, sry for brain lag lol:lol:

    • Like! 1
×
×
  • Create New...
Please Sign In or Sign Up