avgcolor calculation: also calculate alpha for DXT3 git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10684 d7cf8633-e32d-0410-b094-e92efae38249
fix a C++ error git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10681 d7cf8633-e32d-0410-b094-e92efae38249
fix avgcolor calculation with fake S3TC decoding git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10680 d7cf8633-e32d-0410-b094-e92efae38249
add a trivial quarter-res S3TC decoder to DDS loading git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10679 d7cf8633-e32d-0410-b094-e92efae38249
care for the premultiplied-alpha flag when handling DDS files (use DXT2/DXT4 FOURCC when writing, and show a warning when loading if the type is wrong) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10663 d7cf8633-e32d-0410-b094-e92efae38249
fix D3D9 build git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10622 d7cf8633-e32d-0410-b094-e92efae38249
allow loading DXT2 and DXT4 dds files git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10614 d7cf8633-e32d-0410-b094-e92efae38249
particle rendering now uses premultiplied alpha (texture is automatically converted on load, however dds may need to be DXT4 rather than DXT5 now) this should give an fps boost git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10613 d7cf8633-e32d-0410-b094-e92efae38249
remove r_shadow_texturetype cvar (now always uses 2D textures), remove shadowmap cube and rect support removed GL_ARB_texture_rectangle texture support throughout engine (nothing using it) refactored D3D9 path in R_Mesh_SetRenderTargets in unsuccessful attempt to fix D3D9 shadowmapping git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10467 d7cf8633-e32d-0410-b094-e92efae38249
change D3D9 implementation of TEXTYPE_SHADOWMAP textures to use CreateDepthStencilSurface instead of CreateTexture, this fixes lots of errors (PIX works, REF rasterizer works, etc) implement freeing of D3D9 textures disable the texture size padding on D3D9 as it was not the cause of PIX trouble git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10465 d7cf8633-e32d-0410-b094-e92efae38249
restructure the previous fix so it actually does something git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10464 d7cf8633-e32d-0410-b094-e92efae38249
on D3D9 renderer do not allow textures to be uploaded with a size smaller than 2xN or Nx2 because the REF rasterizer refuses these (which makes PIX debugging hard) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10463 d7cf8633-e32d-0410-b094-e92efae38249
split and overhauled R_Upload into two functions: R_UploadPartialTexture - does a partial update for real, not used by anything if gl_nopartialtextureupdates is on R_UploadFullTexture - takes only new pixel data, does appropriate scaling and uploads to video memory git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10416 d7cf8633-e32d-0410-b094-e92efae38249
change R_Upload error from Host_error to Sys_Error, added texture name to the message git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10412 d7cf8633-e32d-0410-b094-e92efae38249
fix almost all g++ -pedantic warnings git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10402 d7cf8633-e32d-0410-b094-e92efae38249
check the proper texture compression extension for deciding whether to S3TC compress git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10399 d7cf8633-e32d-0410-b094-e92efae38249
actually look into DXT1 pixel data to check if it has a 3 in base 4, to check if the transparent pixel value is REALLY used; also enable alpha autodetection again git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10379 d7cf8633-e32d-0410-b094-e92efae38249
use the DDPF_ALPHAPIXELS flag for DDS reading, at least works for ATI Compressonator git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10376 d7cf8633-e32d-0410-b094-e92efae38249
cvar: r_texture_dds_load_dxt1_noalpha; if set, DXT1 alpha detection is disabled, and DXT1 is assumed to have no alpha. Rationale is that ATI Compressonator sometimes picks the alpha'd compression mode [a, (a+b)/2, b, transparent] and then never uses the transparent color value 3, as it sometimes can yield better results than the non-alpha'd compression mode [a, (2a+b)/3, (a+2b)/3, b], and this throws off alpha detection on loading git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10375 d7cf8633-e32d-0410-b094-e92efae38249
make sure the return value of R_PicmipForFlags can't get negative git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10374 d7cf8633-e32d-0410-b094-e92efae38249