Issues with the Paranoia renderer Created 7 years ago2016-10-08 02:24:52 UTC by James Luke James Luke

Created 7 years ago2016-10-08 02:24:52 UTC by James Luke James Luke

Posted 7 years ago2016-10-08 02:24:52 UTC Post #331927
When I implemented the Paranoia renderer (just the stock one, the one that came with the official Paranoia toolkit, it just doesn't want to work right. I know there were quite a few bugs in the original and still need to find workarounds for, such as transparent objects being messed up, animated textures not working, grass not lighting properly, detail textures not working, decals on brush entities being broken, no dynamic lights (like flickering), and so on.

Even when I implemented it into my SDK I get even more bugs.
https://www.youtube.com/watch?v=lO-s-sN3zaA

If anyone knows how to solve any of these, I would appreciate if you could come forward, and maybe help anyone else who have been having these bugs.

A few things to note, when I load the 'opengl32.dll', I changed the manager code to load 'opengl32wl.dll' so I can workaround the VAC stuff, this may have affected alpha and stencil bits as I cannot load them. If you want the mod folder/source please contact me, any help would be great, thanks in advance. Also I have no SOHL features implemented, so maybe need that.
Posted 7 years ago2016-10-08 11:39:31 UTC Post #331931
The shifting occurs because Paranoia's renderer automatically adjusts the flashlight size based on distance to the nearest wall. This is handled in the code that also sets up the flashlight.
'view.cpp' handles the function 'SetupFlashlight', you're right, it does shift and twist based on distance nearest to a wall.
Paranoia never implemented support for detail textures or decals on anything but the worldspawn, so you won't get that working without modifying the rendering code itself.
I kind of assumed that based on what I'm finding in the code, I think you have to put in a special entity that will change the custom light style.
I fixed this in Trinity, but porting the code would require some effort. This thing actually contains a lot of fixes that could be applied to Paranoia, but the code was changed substantially.
I have used Trinity in the past before, but it is very buggy for me. I decided to have a download of it and I see what you mean by being 'changed substantially'
Can you show an example of transparent objects being messed up? Also the engine you're using won't support switchable texture lights, because Paranoia's renderer overrides that functionality to implement bump maps and such.
It's not really so much as a bug as it is a nuisance, basically in game, say when you pick up your suit, the glass doesn't appear to be shaded in with the rest of the environment, might be a lack of the proper RAD that Paranoia's compilers use.
As for changing the name of opengl32.dll, that will disable the renderer entirely I believe. Paranoia used a lot of hacky methods that needed the stencil buffer, etc, and it was programmed to disable itself if it's missing. The hacky opengl32.dll acts as a bridge between Half-Life and the system's actual dll, overriding certain values sent to the GPU. If you rename it or take it out of that folder, it won't work.
I've talked to some of the developers and people who know the engine very well and your right, Paranoia uses a hell of a lot hack-y methods to display their effects. I think a lot of my bugs come from working around the VAC system. Because when Paranoia loaded the library, they used 'opengl32.dll', since hackers used this upload cheats into Half-Life later on, Valve removed the ability to have it. So, to overcome this, I had to rebuild and rename 'opengl32.dll' to 'opengl32wl.dll' to work around that.

I was having a look, and you don't use a external '.dll', you load your functions through shaders? Am I reading that right?

I know ARRANGEMENT does something similar but still haven't found out how, because all their features work right.

Basically I just want to know how to do that, instead of using that damn '.dll'.
I heard of people playing Paranoia in multiplayer with the hacky dll in place, and VAC didn't ban them, but I wouldn't bet my life on it. Maybe someone else can confirm this?
Same, I haven't tried it because I value my Steam account, but I think not having the hack on you can play some multiplayer. I heard it was a lot of fun to use the snipers, but I'm not so sure.
Posted 7 years ago2016-10-08 18:12:46 UTC Post #331933
Custom light styles are not supported in any way by Paranoia, because as I said earlier, Paranoia's hlrad hijacks that to put bump map data alongside the normal lighting information.
Sorry, I meant toggle lights, not dynamic light styles.
As for the hacked dll, Paranoia I believe only uses it to set certain bits in the pixelformadescriptor for alpha and stencil bits, and to hack the depth range for the skybox they have, and to clear bits at the frame start. I can explain how it's used exactly.
That would be great, I want to see if I can fix it in the solution for the source that came for the '.dll'.
I never needed it because I rendered stuff properly, and didn't need ugly hacks, snip
With the way you properly render it, I might be able to do that by changing around some of the calls around. Hopefully it won't require me to add a whole lot of custom code. Any idea how to do the texture tiling thing you were talking about? I don't know much about OpenGL, just a little C++.
You could go on and fix Paranoia's renderer, but unless you want bump maps and specular lighting, it's not worth the effort. Also, you're likely to experience performance issues if you increase the detail in your levels, as a lot of the rendering code is extremely unoptimized.
Yeah, I'd have no idea how to optimize it, there's just code leaking everywhere. Everything seems to topple over and crash and burn whenever removing 1 thing or another. I had to remove the sky-box code to be able to play the game without seeing the sky-box flicker out 5 feet in front of me.
Posted 7 years ago2016-10-08 18:28:10 UTC Post #331934
Based on what i've found, disabling texture tiling is done using glTexParameter: https://www.khronos.org/opengles/sdk/docs/man/xhtml/glTexParameter.xml

GL_TEXTURE_WRAP_S and GL_TEXTURE_WRAP_T with GL_CLAMP_TO_EDGE will do this. This is for immediate mode, if using shaders you'll have to clamp it yourself.
Posted 7 years ago2016-10-08 22:28:49 UTC Post #331947
-snip
Having a look through the code, 'LoadCacheTexture' is used in 'SetupSpotLight', and it has a clamp argument.

[quote]if(clamped)
{
	gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );
	gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP );
}[/quote]
When the game setups the spotlights, I believe it's used with the flashlight code as well, and when loading it, the clamp function is set to TRUE. So I don't know what you mean, unless it doesn't use that to render flashlights, then I have no idea where to put it.
They're the same thing. HL solved switchable lights by providing up to 4 lightmaps stored in the BSP per surface:
1 - Base inanimate lightmap
2, 3, 4 - Lightmaps containing light colors for each light that affects the surface. This can be both switchable lights and animated lights. Paranoia uses this slot to store it's bump map data, thus why switchable lights aren't supported.
I'm guessing there aren't many workarounds? If none?

A better plan would probably be to leave then alone, store the bump data in extra slots, and piggy-back off of it, but that wont work I guess because that would need tapping into the engine.
Posted 7 years ago2016-10-21 20:20:36 UTC Post #332085
I see how using the Paranoia renderer can have it's downfalls, so I decided to move on and restart my project.

I was recently reading on this http://am.half-lifecreations.com/forums/index.php?topic=1062.30#forum and found out you had to use the same Paranoia DLLS, is there any way to load OpenGL effects (including that)? Without the hacked DLL, because it doesn't work on the newer Steam versions?
You must be logged in to post a response.