Lindor 438 Posted January 27 Share Posted January 27 (edited) @Vishanka Found a way to directly use the shader and image responsible for the Endijan Wings effect: 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 Edited January 27 by Lindor 1 Link to comment
Lindor 438 Posted January 28 Share Posted January 28 @Vishanka I experimented some more 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): 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. 1 Link to comment
Vishanka 236 Posted January 28 Author Share Posted January 28 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 Link to comment
Lindor 438 Posted January 28 Share Posted January 28 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: 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 Link to comment
Lindor 438 Posted January 28 Share Posted January 28 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 Link to comment
Lindor 438 Posted January 28 Share Posted January 28 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 I have an idea. The console hint is something valuable I can follow. Link to comment
Lindor 438 Posted January 28 Share Posted January 28 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
Vishanka 236 Posted January 28 Author Share Posted January 28 Either I don't understand what I'm doing or something doesnt work. Where's my mistake? Link to comment
Lindor 438 Posted January 28 Share Posted January 28 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
Lindor 438 Posted January 28 Share Posted January 28 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. 1 Link to comment
gogoblender 3,072 Posted January 28 Share Posted January 28 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 Ive removed the expansion You have the word "sera" now at your disposal 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 1 Link to comment
Vishanka 236 Posted January 28 Author Share Posted January 28 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
Flix 5,116 Posted January 29 Share Posted January 29 8 hours ago, Lindor said: do the standard revelation of the seraphim wings fx work for you with and without S2EE? Yes. 1 Link to comment
Lindor 438 Posted January 29 Share Posted January 29 4 hours ago, Flix said: Yes. Thanks. This is wierd. Photo directly taken from the wiki: 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
Lindor 438 Posted January 29 Share Posted January 29 @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
Vishanka 236 Posted January 29 Author Share Posted January 29 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
Vishanka 236 Posted January 29 Author Share Posted January 29 (edited) 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 January 29 by Vishanka Link to comment
Lindor 438 Posted January 29 Share Posted January 29 (edited) 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. But did it work for you? Edited January 29 by Lindor Link to comment
Popular Post Vishanka 236 Posted January 29 Author Popular Post Share Posted January 29 1 hour ago, Lindor said: But did it work for you? I didn't have time earlier to test it but now :-) I am very happy with this, and I like that it's easy to recolor because I think I will make a blue, red and grey version like uriel, astrala and abdiel from sacred 1. Thank you for your help Meanwhile, it's so much easier if you can paint on the model directly. Finally I can apply all sorts of crazy makeups. I wish I could edit the models too though. 1 1 Link to comment
Hooyaah 2,827 Posted January 29 Share Posted January 29 You do so well with the makeup and include such fine detailing, Vishanka! The model itself and its animations are secreted within the GR2 file. Link to comment
Vishanka 236 Posted January 29 Author Share Posted January 29 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
Hooyaah 2,827 Posted January 30 Share Posted January 30 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
Lindor 438 Posted January 30 Share Posted January 30 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: Spoiler http://files.modacity.net/software/3dsmax/ https://www.chip.de/downloads/3DS-Max-Studentenversion-Vollversion_143692366.html https://archive.org/details/autodesk-3ds-max-8 The first link should be very valuable for any new modders Granny Viewer: Spoiler https://metin2.download/file/n9F95kgk5YPxAtz6ueKT4p2c76f7C8uT/ https://metin2hub.com/threads/granny-viewer-2-11-8-full-fixed.394/ http://www.radgametools.com/granny/history.html http://www.radgametools.com/granny.html Again, the first link should be very valuable for new modders. GR2 Tools: Spoiler Norbyte's tools for Divinity: Original Sin https://forums.larian.com/ubbthreads.php?ubb=showflat&Number=564303 https://s3.eu-central-1.amazonaws.com/nb-stor/dos/ExportTool/ExportTool-latest.zip https://github.com/Norbyte/dos2de_collada_exporter Metin 2: https://metin2.dev/topic/24530-advanced-gr2-tool/ Neverwinter Nights 2: https://github.com/Arbos/nwn2mdk/releases made by this Person, to give Credit: https://www.youtube.com/channel/UCC4Egye0D7AfKCnhh8OSUXw/videos Dmitriy's tools for Sacred 2: https://darkmatters.org/forums/index.php?/topic/23793-sacred-2-model-and-animation-tools/ SUBSIM: https://www.subsim.com/radioroom/showthread.php?t=178605&langid=5 Civilization 5: https://forums.civfanatics.com/threads/nexus-buddy-2-granny-editor-for-civ-5.496855/page-27 NiF file format: https://sourceforge.net/projects/niftools/ Additional Information / Discussions / Tutorials at Darkmatters: Spoiler https://darkmatters.org/forums/index.php?/topic/43222-trying-to-find-a-sacred-2-gr2-importerexporter-for-blender/ https://darkmatters.org/forums/index.php?/topic/40908-need-help-to-3d-print-3d-models-from-sacred/#comment-7051721 https://darkmatters.org/forums/index.php?/topic/72510-having-some-trouble-with-sacred-2-modding-and-a-question-regarding-software-additionally-how-can-I-mod-animations/ https://darkmatters.org/forums/index.php?/topic/21465-whats-the-status-on-granny-viewer-3d/ https://darkmatters.org/forums/index.php?/topic/16371-tutorial-importing-and-exporting-gr2-models/ Wiki Page: Spoiler https://www.sacredwiki.org/index.php/Sacred_2:Modding_software 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
Lindor 438 Posted January 30 Share Posted January 30 Here's a little test series I made Safe to say that fx/ambTEnergy.shader is responsible for the SURFACE_FLAG_TENERGY. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now