Jump to content

Vishankas Mod corner


Recommended Posts

 @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:

Edited by Lindor
  • Like! 1
Link to comment

@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
Link to comment

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. I am almost done with my seraphim-highelf mod.

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


5.jpg_8Uy7XQZ.jpg?width=1920&height=1920

Link to comment
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

 

Link to comment
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

Link to comment

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.

Link to comment

Okay wth now the standard revelation of the seraphim wings don't work anymore for me even if I disable my mods

@Flix

do the standard revelation of the seraphim wings fx work for you with and without S2EE?

Link to comment

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.

Link to comment

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
Link to comment
24 minutes ago, Lindor said:

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

 

yeeks! 

sorry about that... this is from more than 15 years ago when we were using "word expansion" to make acronyms posters were using more clear so that new game players could follow along :D

Ive removed the expansion

You have the word "sera" now at your disposal

:hugs:

gogo

 

ps word filter on this forum is many pages long..if you find any other words that are problematic please post and ill get to it :)

  • Thanks! 1
Link to comment
2 hours ago, Lindor said:

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.

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

Link to comment
8 hours ago, Lindor said:

do the standard revelation of the seraphim wings fx work for you with and without S2EE?

Yes.

  • zomgod! 1
Link to comment
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.

Link to comment

@Vishanka

30 minutes ago, Lindor said:

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.

There we go:

Link to comment
8 hours ago, Lindor said:

There we go:


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

Link to comment
8 hours ago, Lindor said:

No Wing FX. Same as for me.

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

The standard FX never worked, I don't have it without a mod either (and no one knew it was even supposed to exist back in the old forums)

Edited by Vishanka
Link to comment
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?

Edited by Lindor
Link to comment

You do so well with the makeup and include such fine detailing, Vishanka! :JC_gimmefive:

The model itself and its animations are secreted within the GR2 file.

Link to comment
28 minutes ago, Hooyaah said:

The model itself and its animations are secreted within the GR2 file.

I can edit the models, but I can't return them back into the game unfortunately.

Link to comment

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?

Link to comment
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!

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...
Please Sign In or Sign Up