Maximum texture size Created 7 years ago2016-12-17 14:24:21 UTC by seedee seedee

Created 7 years ago2016-12-17 14:24:21 UTC by seedee seedee

Posted 7 years ago2016-12-17 14:24:21 UTC Post #332753
I know skyboxes like to be 256^2 and no more, but I've seen textures that are double that resolution at 512^2 and work perfectly fine. If I try any environment box over 256^2, it will give me some error and the map won't load, so I size them down.

This leads to my question, why can't an skybox be 512^2, but a normal texture can?
Also, what is the most an normal texture could be?
Posted 7 years ago2016-12-17 15:18:10 UTC Post #332754
Don't know your skybox answer, but normal textures can be 262,144 pixels.

So 512x512 works, but so does 1024x256. I've never tried having a side larger than 1024 in Goldsource.
Archie ArchieGoodbye Moonmen
Posted 7 years ago2016-12-17 15:53:00 UTC Post #332755
this problem also bothered me, i was trying to use hd skybox to use more open area maps but its imposible.

skybox should be only 256^2 for each plane.

i tried another sized textures and this causes only error. not all errors crashes the game but not works correctly. such as if you use different texture proportions it only causes tiling of that texture to achieve 256*256.

skyboxes rendered different than other 3d objects. main difference is, normal 3d objects size differs by how far it is. but skyboxes are never change their size or orientation to view origin. skybox only can change its angles.

this gives an ilusion of the sky is way further than other objects.

such as a star in the sky is far compared to a npc in the map.

so my guess is there is no engine function coded to handle size chage of sky texture.

and why it is fixed on 256 pixel texture

i guess this is for performance, i guess skybox always rendered even if it is fall behind of a wall(im not sure about that). so they used 256pixels to hardcode it
Posted 7 years ago2016-12-17 16:59:25 UTC Post #332757
The engine hardcodes the OpenGL image size (R_LoadSkys):
glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, 256, 256, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, pImage);
Where pImage is the image data, and the value 256 is used for width and height.

Quake equivalent: https://github.com/id-Software/Quake/blob/bf4ac424ce754894ac8f1dae6a3981954bc9852d/WinQuake/gl_warp.c#L661

I guess you could request the maximum be increased, so i did that: https://github.com/ValveSoftware/halflife/issues/1765

It's not very likely to happen though.
Posted 7 years ago2016-12-17 17:39:55 UTC Post #332762
wow is it possible to convince valve to change this? :) are they gonna change engine for this kind of request?
Posted 7 years ago2016-12-17 18:08:52 UTC Post #332764
I think I might know why 1024*256 works. My theory is that textures can be at most 262144 pixels in size, width or height don't matter (but they probably have to be powers of two). The square root of 262144 is 512 which explains 512^2, the largest texture possible if you want the texture to be a square.
glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, 256, 256, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, pImage);
Does anyone know why Valve limited this to 256^2? Could it be that once upon a time computers couldn't handle such large resolutions?

I recall that Quake III allowed 512^2 skyboxes, and that game was released ONLY A YEAR after Half-Life.

Is it possible to mod the game and change this value or something?
Posted 7 years ago2016-12-17 18:23:42 UTC Post #332765
skybox always rendered even if it is fall behind of a wall
if my thery about rendering skybox is true.

this means, if you running on fulhd engine draws two fullhd frames in each frame.

i mean 256^2 skybox rendered fullscreen on 1920*1080 pixel then map brushes rendered fullhd as overlapping second image.

this maybe cost some performance

but i got another teory too,

if near wall texture is planned 512^2, then placing far mountain images with higher resolution is meaningless for that game.

i know theories isnt enough but i wanted to say :D
Posted 7 years ago2016-12-17 18:54:47 UTC Post #332766
@Cd5ssmffan: Id Software limited it to 256², Valve never changed it. It's hardcoded in such a manner that it can't be changed without patching the engine, which will likely trigger VAC bans.
Posted 7 years ago2016-12-17 20:08:46 UTC Post #332767
Valve never changed it.
User posted image
Posted 7 years ago2016-12-18 02:09:14 UTC Post #332773
Couldn't you use a custom TGA loader and wrap it around the original sky, it would certainly get around the hard-coded limits.

But obviously, it is irritating for Valve not allowing you to change those pesky values, and it looks like they wont do anything about it.
Posted 7 years ago2016-12-18 07:14:53 UTC Post #332774
come on, leave HL as it is ffs&lol. Theres source for crazier stuff
Posted 7 years ago2016-12-18 07:49:17 UTC Post #332775
Want to be beyond the limits, but still work with GoldSrc stuff? Try Xash3D ;)
Posted 7 years ago2016-12-18 12:18:14 UTC Post #332776
Xash3D is illegal and you will get in legal trouble if you try to release your game using that engine. Valve doesn't like it, just check out Half-Life: Update
Posted 7 years ago2016-12-18 15:51:01 UTC Post #332786
Nope. Only you will get in trouble if you want to greenlight your mod on Steam. You can do the mod to be used with steam, and then run it under Xash3D, that is not illegal!, imho. I was worried about it too but troubles will cone if you want to publish the mod on steam, not if you release it and recommend it to be used under Xash3D. ;) Of course ther will be differences, but all related to how much stuff can handle each engine (Xash3D > Won or Steam ).

:)
Posted 7 years ago2016-12-18 15:56:53 UTC Post #332787
Yeah, the guy that made Half-Life: Update was sent veiled threats from valve when he wanted to put it on greenlight :confused: but he also said that he will get in trouble if he releases it on ModDB, so maybe I will use xash because the mod I have in mind would be better with xash
Posted 7 years ago2016-12-18 17:13:36 UTC Post #332790
Till you release your product for free, with original content and as open-sourced project intended to use for legal Half-Life fans (without distributing the initial content of Half-Life and with a respect to the rightholders), and release it unofficially through the modder's community, I'm sure, Valve will not bring any actions against you. If it's just about the modding, not the business and do not infringe upon Valve's interests, for what they should punish you, just to get the money? Xash3D exists for years, and Valve knows about it. And games under Xash3D (which do not use directly Half-Life's content) also exist with no problems, and haven't been prohibited by Valve too. Finally, you really can release your content without Xash3D itself, if you still have any doubts. Or you can split it in two parts: one that's intended to use with original Half-Life and another for use with Xash3D only (for example, high-resolution content). I think that GoldSrc could be open-sourced long time ago, but because of legal issues for Valve (because GoldSrc is modified version of Quake Engine, though it open-sourced now) and because Half-Life still works fine with current OS'es / hardware and can be sold for money (at least as a part of Half-Life series), this still doesn't happen. So Xash3D is just a way to get updated some features of your favourite game, not because you want to earn or save money in some way.
Posted 7 years ago2016-12-18 18:57:30 UTC Post #332791
You can still get around Half-Life's limits with some workarounds and tricks.
Posted 7 years ago2016-12-18 19:03:46 UTC Post #332792
No if you try to make very complex maps with lots of enemies and effects... sadly. Anyway, what you have to have in mind to keep yourself far from trouble is "no profit, no felony".
Posted 7 years ago2016-12-18 19:10:58 UTC Post #332793
Client-side entity manager? Effects you can get around with some hacks as well.
Posted 7 years ago2016-12-18 20:34:03 UTC Post #332794
Of course I want to profit, but I won't be selling it. The thing I want is people to download it and actually like it (thats the profit I have in mind), nobody wants a bad mod and it would be a waste of time making it :P

Right, I'll use xhash. The menu, however, looks disgusting (the WON version of Half-Life). I'm going to have to change those...
Posted 7 years ago2016-12-18 22:26:45 UTC Post #332796
Of course I want to profit, but I won't be selling it. The thing I want is people to download it and actually like it (thats the profit I have in mind)
That´s not illegal, that´s good!! :)
The menu, however, looks disgusting (the WON version of Half-Life). I'm going to have to change those...
Your menu will look like this with Xash3D:

http://www.moddb.com/mods/zion-warcry/videos/finally-the-reload-call-works#imagebox

:P
Posted 7 years ago2016-12-20 14:47:40 UTC Post #332798
1024x256 works but i think it gets rescaled to 512x256 and you end up with a blurry mess like with those non-power-of-2 48, 192 etc
You must be logged in to post a response.