KyleFan Posted November 2, 2023 Share Posted November 2, 2023 Hi everyone! I’m trying to update a 20-year old mod and fix some issues in it. I was able to do almost everything I wanted except for one thing: there is a room with fog in it, but there’s one door that is not affected by the fog and is clearly visible. Here’s a picture: I thought it was a shader problem so I looked for the door’s textures in every shader file, both in the mod’s pk3 and the base pk3s. I also looked for one of the wall textures’ shader from the same room. I thought if I compare the two shaders I might be able to see the differences that make these two textures affected or not affected by the fog. The thing is: neither of them has any shaders and now I’m completely out of ideas. I could just get rid of that fog to eliminate the problem but my goal is to upgrade the mod, not to downgrade it. Is there a solution to this? Please, let me know. I’d appreciate the help. Smoo and McGroose like this Link to comment
McGroose Posted November 3, 2023 Share Posted November 3, 2023 This is Nemesis of Katarn, correct? Sorry I cannot help, but I just want to point out that I both love this mod and hate how it has other similar problems. Have you seen how in the great chamber (the one like in ESB where Vader cuts off Lukes hand) on the other side of the door in question, the textures do not load properly? It's as if the map is too big. It playys the same effect as if you're falling out of the map via noclip, like you're looking at a void. This and the last level crshes always on OpenJO, are you using OpenJO? Or default? Playing the mod in Jedi Academy with openJK does not have that problem IIRC If you make any progress updating this mod, I'd love if you could address the above problems. Smoo likes this Link to comment
KyleFan Posted November 3, 2023 Author Share Posted November 3, 2023 You are correct, this is Nemesis of Katarn. I know what you mean by looking at a void, but strangely enough, I didn't encounter that problem in this mod. I am using default JO by the way. I have experienced the crashes on the last level, although it only happened whenever I tried loading a save I made on that level. IIRC it was because Kyle had a long sentence that was printed on the screen and the game thought it exceeded a character limit or whatever. That is no longer a problem as I got rid of the printed dialog altogether. Instead I made it possible to play voice lines and the texts to be shown as subtitles. Now, for me at least, crashes no longer happen. I also had issues with some 3D objects that didn't load, and some textures that were pitch black. I corrected those. I worked on the music. Some levels had one music loop, some transitions were not added as music but as background noise... these are now fixed and the levels have dynamic music. I did some scripting. I added some animations to the characters in cutscenes. For door opening cutscenes I repositioned the cameras so that first time players have a better understanding on where that door is on the map. Also where Kyle falls down the shaft, and when he falls out of Cloud City, I made him do the falling animation to make it more realistic. Some minor things I did include slight recoloring of a few textures to better match with the surroundings or with how it looked in the movie, and the reskinning of some character models. This not foggy door is probably the last thing I intended to change. McGroose likes this Link to comment
mjt Posted November 13, 2023 Share Posted November 13, 2023 Any fog that is created by a brush and not globally applied via worldspawnfog (affecting EVERYTHING in the map) can only have one of its faces open to the world, the rest would have to touch a structural plane in the BSP tree. So if you have a corridor with a fogbrush only covering that corridor and it has two open sides that could see each other, it would glitch out. One last hope you have for this is controlling the cull key in the shader (cull none, cull twosided, cull back) and play with q3map_invert on the fogvolume to see if you can cheat your way out of this dilemma. Is the doorbrush itself still contained within the fog volume or does the fogvolume end before the door? Some shaders might have used compile time parameters that weren't included in the shader files released to the world. A mapper could've used q3map_noFog to explicitly exclude surfaces in the BSP tree from being affected by fog. Though I doubt this is the case here. Link to comment
KyleFan Posted November 27, 2023 Author Share Posted November 27, 2023 Thanks for your answer, @mjt! Though I’m not sure I understand everything you said, I'm fairly new to modding. I don’t know what a structural plane in the BSP tree is. I know about the cull key, but I’m not familiar with the q3map_invert. To answer your question about the doorbrush, I thought it would be the best if I show you how it looks in-game. I hope it helps: Smoo and mjt like this Link to comment
mjt Posted November 28, 2023 Share Posted November 28, 2023 I see the issue clearly now. Would help a lot to take a look at the .map file itself. Also the shaders used on the door and floorgrating - as the latter can certainly be made to play nice with fog. One thing that I still suspect is that there are two "open ends" to the fogbrushes instead of just one. KyleFan likes this Link to comment
KyleFan Posted December 3, 2023 Author Share Posted December 3, 2023 I've found the shader for the grating but for the door I couldn't find any. You can look at the shader and the .map file here: https://drive.google.com/drive/folders/1YS1KgD9Bicd9TfwQ1_ko_LhSv4Ivg6FW?usp=sharing mjt likes this Link to comment
mjt Posted December 4, 2023 Share Posted December 4, 2023 (edited) textures/kejim/grate02_long { qer_editorimage textures/kejim/grate02_long sort 3 cull twosided { map textures/kejim/grate02_long alphaFunc LT128 rgbGen identity depthWrite } { map $lightmap rgbGen identityLighting depthFunc equal } { map textures/kejim/grate02_long blendFunc GL_DST_COLOR GL_ZERO rgbGen identity depthFunc equal } } This should fix the floor grating - if you don't get dynamic lights on the grating - try with sort 4 instead of 3. We should also take a look at these shaders: textures/shuttle/shuttleinside2 textures/nar_hideout/conveyor textures/doomgiver/doormaint textures/bespinnew/gantrycor1 textures/bespinnew/bluecarb The door itself looks fine to me, a bit of overlap into structural but the more worrying thing is that the fogbrush has two of its sides visible instead of just one. Up the shaft and where it ends close to the door to the next section of the map. That might be determining fog direction on compile and could be the cause for the door not being affected by fog. It could also be the doors shaders - so if you could upload / share the snippeds requested above, we can exclude that too. Did you decompile the .bsp with GTKRadiants q3map2 or NetRadiant Custom? What I could imagine is that whoever build the map in the first place, was using a map editor where he didn't use the origin brush as part of func doors to set the origin but he just placed his func_doors, edited in the opening directions but didn't set an origin key on the entity itself. That would mean all his func_doors default to having their origin at 0 0 0 coordinates while the doorbrushes / shaders are offset so they appear correct in the .map. But sadly, for fog, it's crucial that the entities origin lies within the fog too. So you'd have to recompile the map with origin brushes in the center of your doors. Edited December 4, 2023 by mjt Remembered Origin Issue KyleFan likes this Link to comment
KyleFan Posted December 4, 2023 Author Share Posted December 4, 2023 Thanks for the grating shader, it worked perfectly! I doublechecked every shader file but found only one of the textures you listed. That is 'textures/bespinnew/bluecarb' which is the fog itself that is in the room. Here's that shader: textures/bespinnew/bluecarb { qer_editorimage textures/bespinnew/bluecarb.tga surfaceparm nonsolid surfaceparm nonopaque surfaceparm fog surfaceparm trans q3map_nolightmap fogparms ( 0 0.54902 1 ) 4000.0 } I decompiled it with GTKRadiant's. Smoo and LeonBabcock like this Link to comment
KyleFan Posted December 19, 2023 Author Share Posted December 19, 2023 So @mjt, what would be your diagnosis of the issue? Is there anything else that can be done? Perhaps the fact that the door textures don't have any shaders have something to do with it? If your idea regarding the func_doors is true then I guess I'll have to accept this door the way it is. Maybe I should play around with the fog distance and color to try and mitigate the problem. Link to comment
SomaZ Posted December 20, 2023 Share Posted December 20, 2023 I just had a look with my WIP version of my Bsp editor, which will have some additional features. The problem is that bsp surfaces get one fog assigned. If it isn't it simply won't draw. A global fog would take place. It's also not just the door, but also the rotating fan that doesn't have the correct fog assigned. I'll try finishing some parts of my bsp editor and then we can try fixing the problem with that. Link to comment
KyleFan Posted December 20, 2023 Author Share Posted December 20, 2023 Huh, I've never even noticed that fan. Anyway, thank you @SomaZ! 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