Lindor 438 Posted April 17, 2022 Share Posted April 17, 2022 (edited) In both CM-Patch and EE, Ancient Bark has FX_SC_SCHILD as spell FX. However there exist rindenhaut.shader and rindenhaut2.shader, implying that FX_DR_RINDENHAUT should exist. Also Flix' FX list implies that. Does Vanilla spells.txt have FX_DR_RINDENHAUT as ancient bark's spell FX? And if so, why was it changed? And if not so, why do these files exist? EDIT: Go to this post to get the shader and instructions how to use: Screenshot example for the new shader at work: Edited April 19, 2022 by Lindor Link to comment
Flix 5,116 Posted April 17, 2022 Share Posted April 17, 2022 FX_DR_RINDENHAUT is just a god-awful looking FX. CM Patch replaced it with the FX_SC_SCHILD, somewhere around v.1.30, I believe. I preserved it in EE because I agreed with the change. I've tried to work with the three textures of FX_DR_RINDENHAUT to make it look like something at least bark-ish if nothing else. It's just too... overwhelming. It completely masks the underlying creature textures and doesn't respect any MASKED surface entries. I'm convinced something is actually wrong with the way it's coded. hq\fx\dr_rindenhaut.dds -- makes the brown "leopard spot" pattern hq\fx\dr_rindenhaut2.dds -- the bright green glow. hq\fx\dr_rindenhaut3.dds -- doesn't seem to do anything whatsoever. Ironically this is the one texture that looks like bark. Playing "musical chairs" with the textures and trying a few recolors resulted in the following: Of these I think the bottom left one looks the best. Dmitriy made a pretty good version in Addendum, which seems to draw on elements of both the original Rindenhaut and also the SC_Shield. Maybe you can see what he did with the shaders. 1 Link to comment
Lindor 438 Posted April 17, 2022 Author Share Posted April 17, 2022 (edited) 18 hours ago, Flix said: FX_DR_RINDENHAUT is just a god-awful looking FX. Aah, so it was purely cosmetic. 18 hours ago, Flix said: It completely masks the underlying creature textures and doesn't respect any MASKED surface entries. I'm convinced something is actually wrong with the way it's coded. Actually it looks like everything works as scripted in the shader. The reason for it not working MASKED is probably that it is a 3d texture. I think I understand how it works and can make it look better. Btw FYI the shader makes the FX clip (aka the pixels not being rendered, and I really mean pixel, not vertex) wherever the alpha channel of the texture0 falls below 30%. It's a yes/no thing, no possibility for different levels of alpha. I can change that I think. Also I can make it work differently for glow and diffuse. Btw the third texture really doesn't do anything. Both shaders expect only one texture. One shader for the diffuse and one for the glow. But I can't make the anicent bark shader work like the scorpion shader, partially bcs the scorpionshield shader is way more complex than the ancient bark one, I don't understand everything, partially bcs there's limitations: I can't influence the files tied to the FX. The SC expects 4 textures, and I can't bind 3 more textures to the FX cause that's hardcoded. I can decrease the number of textures a shader expects, but never increase it. 18 hours ago, Flix said: Maybe you can see what he did with the shaders. That is the plan 18 hours ago, Flix said: Maybe you can see what he did with the shaders. Not much actually, as far as I can tell. Ancient Bark as well uses FX_SC_SCHILD and using the N++ compare plugin I can tell the only thing he changed was a single parameter which, if I interpret it correctly, it makes the glow slowly move along the y-axis with the ingame time. As a side effect the glow texture has to be 1960 pixels wide along the y axis now in order to avoid jumps. The main change needs to be in the four texture files the shader expects. Wierdly, the scorpion in addendum now uses FX_RINDENHAUT. But D didn't change anything about the ancient bark shader. One more thing: I found a unverwundbar.shader. Achilles e.g was "unverwundbar". Well, nearly. At the beginning of the shader it says // skorpionshield. But I don't see why this exists, the FX_SC_SCHILD has two different shaders. Another mystery I want to know more about. EDIT: 33 minutes ago, Lindor said: Not much actually, as far as I can tell. Ancient Bark as well uses FX_SC_SCHILD and using the N++ compare plugin I can tell the only thing he changed was a single parameter which, if I interpret it correctly, it makes the glow slowly move along the y-axis with the ingame time. As a side effect the glow texture has to be 1960 pixels wide along the y axis now in order to avoid jumps. Accidentally swapped Addendum with CM one, D disabled this feature, not enabled it. This also explains why there's this whole chunk of code set up in the shader file that is not even used. It was used in CM and got disabled in Addendum, not vice versa. Still wierd that D just flipped that single value instead of just deleting this whole chunk of now unnecessary code, thus improving performance. So without having played an Addendum Dryad yet, I assume the ancient bark fx glow is now not moving anymore or at least more slowly? Because that would confirm my interpretation of the code I'm seeing. Edited April 17, 2022 by Lindor Link to comment
gogoblender 3,071 Posted April 17, 2022 Share Posted April 17, 2022 Always hated this skin, though i loved playing the dryad. When I see Flix,s image here: For maybe the first time ever im thinking .. do you guys think it was created this way as a kind of Easter Egg to the first time we all saw the world through the Predator's eyes in Arnold Schwarzenegger's epic Predator? I remember everyone in the audience gasping in awe when we saw this imagery on the big screen back then, all connected to alien"s concept of jungle subterfuge ^^ 1 Link to comment
Flix 5,116 Posted April 18, 2022 Share Posted April 18, 2022 2 hours ago, Lindor said: Not much actually, as far as I can tell. Ancient Bark as well uses FX_SC_SCHILD Sorry about that, you're right, he actually kept that effect in place for Ancient Bark, changing the textures to use more green, and slowing down the shader movement, making it look like this: He then gave FX_DR_RINDENHAUT to the Scorpion boss. The FX now looks like this, which is actually pretty neat. 2 hours ago, Lindor said: The reason for it not working MASKED is probably that it is a 3d texture. Ah, I see, it's a volume map. I've never made nor edited one of those. Loaded in GIMP it kind of looks like an image with 100 slightly different layers. 1 hour ago, gogoblender said: Easter Egg to the first time we all saw the world through the Predator's eyes in Arnold Schwarzenegger's epic Predator? That is such a great movie. I mean, that's a good of an explanation as any! 1 Link to comment
Lindor 438 Posted April 18, 2022 Author Share Posted April 18, 2022 8 minutes ago, Flix said: and slowing down the shader movement perfect! So my interpretation is probably correct, thx! 11 minutes ago, Flix said: The FX now looks like this, which is actually pretty neat. Looks like T-Energy glow and the holes are bigger. Again must've been done at the texture level, no changes to rindenhaut.shader or rindenhaut2.shader. Link to comment
Lindor 438 Posted April 18, 2022 Author Share Posted April 18, 2022 (edited) 12 hours ago, Lindor said: Btw the third texture really doesn't do anything. Both shaders expect only one texture. One shader for the diffuse and one for the glow. Wrong! sry for that. Both shaders expect 2 textures, the volume map and texture0. It might be that the hardcoded linking is off and links the glow map to both rindenhaut.shader and rindenhaut2.shader, but it is more likely that the glow, rindenhaut2.shader, just masks the underlying diffuse, rindenhaut.shader. A way to solve this is to inverse the clipping for rindenhaut.shader, which I can do. EDIT: actually rindenhaut.shader's texture0 doesn't do anything despite the script expecting it. The diffuse color is made of the volume maps color. Curious why they chose to go the 3d way. So that curved meshes don't distort the holes? Hm. EDIT2: I know why. It's about the intersection of a 2d surface with a 3d volume map which makes the leopard spots change size and form, merge and split and rotate and wobble. If it was a 2d map, the leopard spots would just move around the mesh but not change their appearance. Edited April 18, 2022 by Lindor Link to comment
Popular Post Lindor 438 Posted April 18, 2022 Author Popular Post Share Posted April 18, 2022 (edited) @Flix I have successfully altered the shaders for PFP needs. The thing is that a modder always has a vision. If I'd change the ancient bark spell FX, I'd use a green-brown recolorized goldenglade touch spell FX. However that does not fit within the goals of PFP. It is up to you Ben as how much of a change you find acceptable until it becomes too much of a mod. I figured it would be best if I reworked the shader so that it gives the most amount of modding freedom to you how you want it to look. The clipping will still be controlled by a 3d texture, not 2d. I've tried that, and it's not possible without hardcoding abilities due to code limitations. You can however still use a 2d map; as a result the FX won't move. The diffuse map (hq\fx\dr_rindenhaut3.dds) will now be used instead of the volume map's colorization. Both glow and diffuse map now have a properly working alpha channel. For the diffuse map, it was a decision between making the image's alpha channel have an ingame alpha channel effect or an ingame glow effect. If the latter is more wished than the former, I can provide it. Another possibility would be making the glow dependent on one of the volume map's color channels since they're currently unused, it's just there for the alpha channel. The glow will not overlap the diffuse map so drastically anymore. It is now purely border of the leopard spots. The white component has been removed from the leopard spots borders, the glow map alone will now define the color. Here's an example image of what it looks like with the generic EE images: Any additional wishes/ideas, like making the diffuse or glow map move around or so, can and will be implemented. These are the instructions with installing the shaders: extract a copy of shader.zip replace unified/objects/fx/rindenhaut.shader with this code in N++: Spoiler // dr rindenhaut #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 texcoord : TEXCOORD0; }; struct fragout { float4 col[2] : COLOR; }; pixdata mainVS(appdata I, uniform float4x4 worldViewProjMatrix) { pixdata O; // position float4 pos4 = float4(I.position, 1.0); // transform O.hposition = mul(pos4, worldViewProjMatrix); // tc's O.texcoord = I.texcoord.xyyy; return O; } fragout mainPS(pixdata I, uniform float4 pix_data_array[4], uniform float4 param, uniform sampler2D texture0, uniform sampler3D textureVolume) { fragout O; // gice usefull names float time = pix_data_array[0].x; s2half4 tex0 = tex2D(texture0, 10.0 * I.texcoord.xy); // get animated normal s2half4 holes = tex3D(textureVolume, float3(I.texcoord.xy, 0.07 * time)); // weg, wenn nicht in hole clip(holes.a - 0.3); // out O.col[0] = tex0; O.col[1] = float4(0.0, 0.0, 0.0, 0.0); return O; } Replace unified/objects/fx/rindenhaut2.shader with this code in N++: Spoiler // dr rindenhaut #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 texcoord : TEXCOORD0; }; struct fragout { float4 col[2] : COLOR; }; pixdata mainVS(appdata I, uniform float4x4 worldViewProjMatrix) { pixdata O; // position float4 pos4 = float4(I.position, 1.0); // transform O.hposition = mul(pos4, worldViewProjMatrix); // tc's O.texcoord = I.texcoord.xyyy; return O; } fragout mainPS(pixdata I, uniform float4 pix_data_array[4], uniform float4 param, uniform sampler2D texture0, uniform sampler3D textureVolume) { fragout O; // gice usefull names float time = pix_data_array[0].x; // get animated hole-edge-detecetion texture s2half4 holes = tex3D(textureVolume, float3(I.texcoord.xy, 0.07 * time)); // get animated overlay texture s2half4 border_color = tex2D(texture0, 10.0 * I.texcoord.xy); //volume map's alpha min and max for border //float alphamin = 0.05f; //float alphamax = 0.7f; //sinus //s2half border_glow = sin(((holes.a - alphamin) * 3.14159265) / (alphamax - alphamin)); //positive slope //s2half border_glow = (holes.a - alphamin) / (alphamax - alphamin); //negative slope //s2half border_glow = (alphamax - holes.a) / (alphamax - alphamin); s2half border_glow = 5 * holes.a - 0.5; // compose s2half4 border = border_glow * border_color; clip(holes.a - 0.1); clip(0.3 - holes.a); // out O.col[0] = float4(border.xyz, border_color.a) + float4(0.01, 0.01, 0.01, 0.01); O.col[1] = float4(border.xyz, border_color.a); return O; } zip shader.zip again and put it in your mod go to C:\Users\Username\AppData\Local\Temp\Ascaron Entertainment\Sacred 2 and delete shader.cache Done, you can now use GME to enable your mod. Edited April 19, 2022 by Lindor Reason: updated the code for the final version of the shaders 2 Link to comment
Vishanka 236 Posted April 18, 2022 Share Posted April 18, 2022 Just an idea and I don't know if that would be feasible. That thing is called Ancient Bark or Rindenhaut; how about applying any shader just to the skin layers but not over the armor? Link to comment
Flix 5,116 Posted April 18, 2022 Share Posted April 18, 2022 Really great work! In case there was confusion, there are absolutely no plans to change the FX for PFP, that's outside the scope of the mod. Depending on how it looks I'm sure it will have some useful application in D2F though. I've thrown in everything plus the kitchen sink with this next release work regards to FX. Link to comment
Lindor 438 Posted April 18, 2022 Author Share Posted April 18, 2022 (edited) Thx for all the positive feedback! The project is not finished yet, there are more things improvable. The original code had half the size of the leopard spots and 10 times the resolution of the diffuse map. Initially I changed that thinking that I'd increase resolution and decrease spot size when in fact I was doing the exact opposite. Re-enabling the resizing parameters made it really look 10 times better: I have updated the code within the post above to fit the higher res shader. Also I'm thinking about clipping the glow effect for high opacity of the volume maps alpha, this way the sparkling of the diffuse maps on regions with low alpha should be reduced. Also I think I'm gonna repurpose the volume map's colorization into a normal map. Last but not least, I think I'm gonna change the border glow. Currently it's a sinus peak, but it could also be a pure positive or negative slope, will see what looks better. 10 hours ago, Flix said: Depending on how it looks I'm sure it will have some useful application in D2F though. I've thrown in everything plus the kitchen sink with this next release work regards to FX. Haha glad to read that. However there are just half of the FX listed currently in the FX list, there is so much more awaiting as indicated by your list. I'm getting consumed by my shader project rn, but I haven't forgotten about the FX list. But the plans I have for upcoming new shaders are just too exciting, esp. the possibility to finally achieve the starry pattern I want for the Deylen set. 11 hours ago, Vishanka said: Just an idea and I don't know if that would be feasible. That thing is called Ancient Bark or Rindenhaut; how about applying any shader just to the skin layers but not over the armor? Good idea, but I don't even know wether that's possible. If it is, then I'm definitely not understanding enough to do that yet. I'm currently learning about the Pixel shader part, but your idea would be settled in the Vertex Shader half. But my guess is that it's probably hardcoded into the I.position parameter. Edited April 18, 2022 by Lindor 1 Link to comment
Vishanka 236 Posted April 18, 2022 Share Posted April 18, 2022 2 minutes ago, Lindor said: Good idea, but I don't even know wether that's possible. If it is, then I'm definitely not understanding enough to do that yet. I'm currently learning about the Pixel shader part, but your idea would be settled in the Vertex Shader half. But my guess is that it's probably hardcoded into the I.position parameter. I thought of the possibility to change the skin color at character creation and the way that affects all the armor items, even those with skin parts on them, maybe there is a way to do anything with that behaviour. There are those _hx.dds files, with just the skin selection for items... and I don't know what I'm talking about but perhaps you have an idea Link to comment
Lindor 438 Posted April 18, 2022 Author Share Posted April 18, 2022 (edited) 38 minutes ago, Vishanka said: I thought of the possibility to change the skin color at character creation and the way that affects all the armor items, even those with skin parts on them, maybe there is a way to do anything with that behaviour. There are those _hx.dds files, with just the skin selection for items... and I don't know what I'm talking about but perhaps you have an idea I've taken a look at skin.shader. The color of skinned items comes from texture3, and I'm pretty sure they hardcoded the linking of texture3 to be dependent on the skin color you choose. Actually I think that's a CM-Patch achievement. Or otherly stated: you're wearing a skin above your skin. Trying to change the behaviour of FX is a whole different story. It would be necessary to clip the FX dependent on Vertex position. This dependency could be achieved through the alpha channel of called texture3 of skinned items and for non skinned items the whole surface would need to be clipped. For that it would be necessary to "send" information from one shader to the other. That is not possible without hardcoding. Edited April 18, 2022 by Lindor Link to comment
Popular Post Lindor 438 Posted April 19, 2022 Author Popular Post Share Posted April 19, 2022 (edited) Unfortunately imgurs max height pixel size is 3000. With sinus / positive slope / negative slope is the function glow of Volume map's alpha channel meant. So e.g. for positive slope, the inside of the border glows the most. You can see the effect alpha scaling has on negative slope e.g., there's a visible gap between the border and the bark texture. EDIT: I have decided what to go for: Small border size, doubled leopard spot size (which has the side effect of doubling border width without increasing the amount of border per texture), color luminosity of border scaling with glow function, alpha of border not scaling with glow function and the glow function islinear with positive slope. This will be the final version of the shaders, the code a couple posts above has been edited. Btw this is how it looks with rindenhaut3.dds at full opacity? opaqueness?: Spoiler Edited April 19, 2022 by Lindor 2 Link to comment
Flix 5,116 Posted April 20, 2022 Share Posted April 20, 2022 That's pretty damn good. Will be an even better choice than the SC_SHIELD for Ancient Bark in EE, I think. I really appreciate you describing what you did. 1 Link to comment
gogoblender 3,071 Posted May 1, 2022 Share Posted May 1, 2022 On 4/18/2022 at 10:54 PM, Lindor said: Unfortunately imgurs max height pixel size is 3000. With sinus / positive slope / negative slope is the function glow of Volume map's alpha channel meant. So e.g. for positive slope, the inside of the border glows the most. You can see the effect alpha scaling has on negative slope e.g., there's a visible gap between the border and the bark texture. EDIT: I have decided what to go for: Small border size, doubled leopard spot size (which has the side effect of doubling border width without increasing the amount of border per texture), color luminosity of border scaling with glow function, alpha of border not scaling with glow function and the glow function islinear with positive slope. This will be the final version of the shaders, the code a couple posts above has been edited. Btw this is how it looks with rindenhaut3.dds at full opacity? opaqueness?: Reveal hidden contents It’s awesome! I remember being very disappointed when I found out that putting on the path which was necessary to just survive make the character look ugly and almost unrecognizable her features and pretty parts of her armour all washed away… I love how much time you put into this really making an effort to find a balance to this dilemma I would’ve loved seeing the dryad this way when I first started playing you have a sensitive And sharp eye for details in this game Thank you for this work 🙏 gogo 1 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