Lindor 438 Posted January 30 Share Posted January 30 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. Link to comment
Lindor 438 Posted January 31 Share Posted January 31 (edited) 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, 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. Edited January 31 by Lindor Link to comment
Lindor 438 Posted January 31 Share Posted January 31 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 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. Link to comment
Lindor 438 Posted January 31 Share Posted January 31 You can also make it more transparent in the add-t-energy.shader. I think I like that more 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; } 1 Link to comment
Vishanka 236 Posted January 31 Author Share Posted January 31 18 minutes ago, Lindor said: You can also make it more transparent in the add-t-energy.shader. I think I like that more Nice work! Would it be possible to make the whole thing even more transparent and only the t-energy effect would make it look more solid? So that the base glow is very faint Link to comment
Vishanka 236 Posted January 31 Author Share Posted January 31 Already edited the file, I think I like it like this 1 Link to comment
Lindor 438 Posted January 31 Share Posted January 31 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. Link to comment
Vishanka 236 Posted January 31 Author Share Posted January 31 58 minutes ago, Lindor said: 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. Can you change the color of the effect, for example to red? Link to comment
Lindor 438 Posted January 31 Share Posted January 31 35 minutes ago, Vishanka said: Can you change the color of the effect, for example to red? Ye just edit the textures. In the surface.txt file which contains just the changes I tried to describe what each texture of the surface does, though I admit that it's a bit more complicated than I described. Just play around with it; e.g. if you swap texture1Name to "fx/te_fx.tga" you get a red-ish background. Link to comment
Popular Post gogoblender 3,072 Posted January 31 Popular Post Share Posted January 31 4 hours ago, Vishanka said: Already edited the file, I think I like it like this extraordinary! love your work Vishanka gogo 2 Link to comment
Lindor 438 Posted February 10 Share Posted February 10 On 1/31/2024 at 7:19 PM, Vishanka said: Can you change the color of the effect, for example to red? On 1/31/2024 at 7:59 PM, Lindor said: Ye just edit the textures. I'm curious. Are there any interesting colors / texture combinations which you did come up during experimenting? Would love to see some more of your work Link to comment
Popular Post Vishanka 236 Posted February 10 Author Popular Post Share Posted February 10 5 hours ago, Lindor said: I'm curious. Are there any interesting colors / texture combinations which you did come up during experimenting? Would love to see some more of your work I have not continued on the wings specifically yet, as I'm still on the whole mod that would replace the seraphim model with the highelve model. But I'm starting to think that the mod will be too complicated to be released actually. I have added all the animations, even came up with a solution for the BFG, but I don't have an animation for the BFG when she's riding, so not sure what to make of that one. Such issues. Almost wanting to bribe dimitrius into giving me more animations from the dryad. Might release it anyway despite some issues. Overall it works quite well. Maybe if I want that mod there is one person out there that wants it too and then it's for them. I'll come to the wings again when I've decided on a color scheme to make the whole thing more pretty. I want all armor pieces to fit together in some ways and move away from the "green gloves, pink belt, blue legs, white chest" thing that makes it look like carneval. But not taking away too much so that it's still an eyecandy to find a different item, so I'll probably recolor everything. (and the rest of the time I'm busy dying in hardcore) 1 1 Link to comment
Vishanka 236 Posted February 10 Author Share Posted February 10 @Lindor Actually I want to look into materials. Let's take these legs for example. How can I add two more material layers so that the thigh cotton would for example be silk and the blade on the knee metal? Link to comment
gogoblender 3,072 Posted February 10 Share Posted February 10 1 hour ago, Vishanka said: (and the rest of the time I'm busy dying in hardcore) I can relate! gogo Link to comment
Lindor 438 Posted February 10 Share Posted February 10 22 minutes ago, Vishanka said: @Lindor Actually I want to look into materials. Let's take these legs for example. How can I add two more material layers so that the thigh cotton would for example be silk and the blade on the knee metal? The material for each itemtype is specified in iteminfo.txt. I don't know what happens if you specify multiple iteminfos for the same itemtype, but I guess that most likely the one furthest down the script will overwrite all others. In order for there being multiple materials for an item, I think one would need multiple itemtypes for an item, like it's e.g. the case with the armored spiders. The saddle of the spider mount has a different itemtype than the body e.g., 13341=saddle, 13342=body. But I don't know wether achieving this for a blueprint.txt item is possible. E.g. "dagger_1h_normal" has multiple itemtypes, but I don't know wether, like for the spider, they all come together to create one model or the game just randomly picks one if the item drops. Link to comment
Vishanka 236 Posted February 10 Author Share Posted February 10 Maybe I have not used the correct words, I am pretty much a rookie; mean something like the diamond set of the highelve, to me it looked like there were 2 surfaces, one for the metal part and one for the rest, but maybe that's just not how it works. Link to comment
Popular Post Lindor 438 Posted February 10 Popular Post Share Posted February 10 9 minutes ago, Vishanka said: Maybe I have not used the correct words, I am pretty much a rookie; mean something like the diamond set of the highelve, to me it looked like there were 2 surfaces, one for the metal part and one for the rest, but maybe that's just not how it works. Oh that's what you mean. Each itemtype has a material of material.txt assigned, the material e.g. specifies how it sounds if it gets hit or walked on etc. I thought you meant that. Classic misunderstanding. For your question let me quote Flix: On 2/20/2022 at 5:17 AM, Flix said: Each GR2 file has materials assigned to it that are named after the corresponding surface entries. To accomplish your goal you need only make a new surface entry, name it whatever you like, and list out the textures that compose it. Next, you edit the itemtype in question (or create a new itemtype if you want the original one intact), and then assign your new surface entry to the model. To demonstrate this we will look at an example: name = "models/npc/wildanimals/bear/v_baer-v1@crystal.GR2", -- the base model surface0 = { mgr.surfGetID ("baer-v1_v"), mgr.surfGetID ("baer-v1-crystal-v2_v") }, -- the first listed surface entry ("baer-v1_v") is the one the model expects to find based on its materials. The second entry in this line ("baer-v1-crystal-v2_v") is the new one that overrides the base surface. surface1 = { mgr.surfGetID ("crystal_z"), mgr.surfGetID ("crystal-v2_z") }, -- the same process repeats as before, for as many surface entries as the original model expects. If you can't figure out which surface entries the base model expects, you can quickly view the mesh's assigned materials with Granny Viewer. It should be noted that this doesn't always work, e.g. the Fen Fires don't have their FX assigned to the model. For them it's a hardcoded link to the surface. But most of the time, you can use grannyviewer to figure out which surfaces the model expects. 1 1 Link to comment
Vishanka 236 Posted February 13 Author Share Posted February 13 There is this skin color slider. The values which color is chosen, are they editable somewhere? I use the same texture on seraphim and highelf but highelf is lighter so the solution is not the texture, but some file with the color values. Does anyone know something? Link to comment
idbeholdME 394 Posted February 17 Share Posted February 17 Good job on the wing effect. Got it to work with the PFP easily enough: I am wondering though - was the effect always supposed to be there in the PC version, but was just broken in some way, or was it an entirely new thing in the console versions and this mod just retroactively adds it to the PC version? Link to comment
Vishanka 236 Posted February 17 Author Share Posted February 17 2 hours ago, idbeholdME said: I am wondering though - was the effect always supposed to be there in the PC version, but was just broken in some way, or was it an entirely new thing in the console versions and this mod just retroactively adds it to the PC version? It has been present on Console but never worked on PC. But it was supposed to work. Link to comment
idbeholdME 394 Posted February 18 Share Posted February 18 5 hours ago, Vishanka said: But it was supposed to work. So it has been present in the code, but just not functioning? I am mainly wondering about whether this is a bug fix, or a modification. Link to comment
Popular Post Lindor 438 Posted February 18 Popular Post Share Posted February 18 8 hours ago, idbeholdME said: So it has been present in the code, but just not functioning? I am mainly wondering about whether this is a bug fix, or a modification. Well both. Spoiler On 1/29/2024 at 10:06 AM, Lindor said: @Vishanka There we go: This has never been part of the game and is something completely new. Spoiler On 1/31/2024 at 5:36 PM, Lindor said: There you go: Depends on your perspective. Something like this should work the way it was coded in the original game, but it didn't on PC, it only worked on console. Console and PC use sometimes different kinds of shaders so I figured I could backtrace the error, but I couldn't, there is no logical explanation up to this point why it doesn't work on PC. The game just won't accept SURFACE_FLAG_TENERGY for this itemtype no matter what you do. So instead I was able to backtrace the exact pixel shader which is responsible for the SURFACE_FLAG_TENERGY-effect and script my own shader which applies the effect to the surface which uses the shader. It's a workaround to get the game into rendering the FX without using the flag. Pixel Shaders take coordinates and textures as input and give you one or more rgba colors as output. Most of the time the input textures are specified in surface.txt, but sometimes, like e.g. for surface flags, it's hardcoded, so I had to guess the input textures. If you are however willing enough to experiment through all the different textures of the game to figure out exactly what textures SURFACE_FLAG_TENERGY uses (or if you're skilled enough to read it from the dll's), then there's (with one exception I'll talk about later) no difference between how it's originally suposed to work and this, so you could consider this a fix. If you just use my guessed textures, then there might be a slight difference and you could, depending on your perspective, this either consider as a mod or a fix. There's one difference however which I allowed myself to make as I would personally consider this a 'fix': The shader I use is responding to the alpha channel. For the original surface flag, it was 'all-or-nothing', meaning that it was hardcoded that beyond a certain alpha channel threshold of the input diffuse texture, the fx would gain a fixed amount of opaqueness, ~90% I'd say, and below that threshold it would not get rendered. My effect however directly gains the opaqueness of the input diffuse texture's alpha channel. Personally I'd conider this a fix, but you could very well consider this a mod if you're absolutely purist and want to push it to the extreme. 1 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