qbismSuper8 builds

Discuss programming topics for the various GPL'd game engine sources.
Post Reply
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: qbismSuper8 builds

Post by mh »

Have a look at FitzQuake's "fog" command - it's what's most likely going to be compatible with the way fog is handled in current and future maps, and will also protect you well if a mod stuffcmds "fog" rather than sending an svc_fog (or setting it via worldspawn) - you'll be dealing with this kind of thing a lot if you ever implement Nehahra support so it makes sense to start off on a decent grounding.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

mh wrote:Have a look at FitzQuake's "fog" command - it's what's most likely going to be compatible with the way fog is handled in current and future maps, and will also protect you well if a mod stuffcmds "fog" rather than sending an svc_fog (or setting it via worldspawn) - you'll be dealing with this kind of thing a lot if you ever implement Nehahra support so it makes sense to start off on a decent grounding.
I used my time machine to go back and add it to build 63. :wink: "fog" command is actually in there, but needs work. The density is not variable yet [edit] and is too weak to be noticed in most ID maps. I plan to compare density to hardware engines and adjust.
mankrip
Posts: 924
Joined: Fri Jul 04, 2008 3:02 am

Re: qbismSuper8 builds

Post by mankrip »

qbism wrote:
mankrip wrote:- Entering the menu didn't free the mouse cursor, so I had to alt-Tab to switch back here to write, and now the engine doesn't capture the mouse anymore, not even its buttons. The only way to fix this was by using a fullscreen mode.
- On Windows 7, I couldn't duplicate the mouse capture problem. It released cursor at menu and recaptured upon exit menu and regain focus. I've got access to an XP machine. What Windows version are you using (or Linux/Wine)?
I'm on Windows XP SP3 32-bit. I just tried it again, and now the problem is almost the opposite: alt-Tab didn't free the mouse cursor (in windowed mode, haven't tried fullscreen this time), so it was useless and I had to alt-Tab back to the engine and close it to free the mouse cursor.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
Dev blog / Twitter / YouTube
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

Balancing fog density and color.
quakespasm + honey.bsp:
Image

upcoming super8 (a separate issue to address- a tendency toward green noticeable in foreground shading):
Image
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

Build 72: http://super8.qbism.com/wp-content/uplo ... 8_0072.zip

Support of fog worldspawn and entities in maps. "fog" console command. Built w/ latest Codeblocks Advanced, optimized for Core 2 (any issues w/ older machines?) Runs 20% faster per bigmap timedemo on an Core i3.
Image
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: qbismSuper8 builds

Post by revelator »

Thats quite a nice speed improvement :) seems atleast something works good with the 4.7.0 gcc.
Productivity is a state of mind.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: qbismSuper8 builds

Post by leileilol »

It crashes when I start it. It happens after it sets the video mode (and the video mode set is the only text you see)

AMD PHENOM FTW
i should not be here
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

The download has been updated to include three executables.
qbism.exe - should run on almost any PC, Pentium or higher.
qbism-icore.exe - optimized for icore, big speed gain, but requires Intel Core 2 or above. This includes the new i3, i5, and i7. I don't know if it will run on any newer AMDs.
qbism-athlon.exe - optimized to run on AMD Athlon XP and up.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: qbismSuper8 builds

Post by leileilol »

Sadly, the Athlon build doesn't run faster than the regular build for me. 28fps with fog.
i should not be here
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Re: qbismSuper8 builds

Post by mh »

The icore build went maybe 10% faster in a timedemo demo1 for me. I tried a big map to see what kind of difference I'd get there but wasn't really able to tell - it seemed smoother but how much of that was my mind playing tricks because I wanted it to be smoother? Suggest an FPS counter.

For kicks I tried the Athlon build on my i7 - it went no faster (I didn't expect it to) but the good news is that it didn't crash or do anything nasty, so if one of those wacky players does this, at least it's not going to be any worse than the regular build. I'd call that a good result. :)
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: qbismSuper8 builds

Post by revelator »

i think to get a reliable result we need to implement cpu specific math in the code. something like the mmx functions from tenebrae but including sse sse 2-3-4 and similar for athlon.

snip from the tenebrae math.c

#if _MSC_VER
#include <xmmintrin.h>
#endif

Code: Select all

void VectorSubtract (vec3_t veca, vec3_t vecb, vec3_t out) 
{ 
#if _MSC_VER 
   // raynorpat: msvc sse optimization 
   __m128 xmm_veca, xmm_vecb, xmm_out; 

   xmm_veca = _mm_load_ss(&veca[0]); 
   xmm_vecb = _mm_load_ss(&vecb[0]); 
   xmm_out = _mm_sub_ss(xmm_veca,xmm_vecb); 
   _mm_store_ss(&out[0],xmm_out); 

   xmm_veca = _mm_load_ss(&veca[1]); 
   xmm_vecb = _mm_load_ss(&vecb[1]); 
   xmm_out = _mm_sub_ss(xmm_veca,xmm_vecb); 
   _mm_store_ss(&out[1],xmm_out); 

   xmm_veca = _mm_load_ss(&veca[2]); 
   xmm_vecb = _mm_load_ss(&vecb[2]); 
   xmm_out = _mm_sub_ss(xmm_veca,xmm_vecb); 
   _mm_store_ss(&out[2],xmm_out); 
#else 
   out[0] = veca[0]-vecb[0]; 
   out[1] = veca[1]-vecb[1]; 
   out[2] = veca[2]-vecb[2]; 
#endif 
} 

void VectorAdd (vec3_t veca, vec3_t vecb, vec3_t out) 
{ 
#if _MSC_VER 
   // raynorpat: msvc sse optimization 
   __m128 xmm_veca, xmm_vecb, xmm_out; 

   xmm_veca = _mm_load_ss(&veca[0]); 
   xmm_vecb = _mm_load_ss(&vecb[0]); 
   xmm_out = _mm_add_ss(xmm_veca,xmm_vecb); 
   _mm_store_ss(&out[0],xmm_out); 

   xmm_veca = _mm_load_ss(&veca[1]); 
   xmm_vecb = _mm_load_ss(&vecb[1]); 
   xmm_out = _mm_add_ss(xmm_veca,xmm_vecb); 
   _mm_store_ss(&out[1],xmm_out); 

   xmm_veca = _mm_load_ss(&veca[2]); 
   xmm_vecb = _mm_load_ss(&vecb[2]); 
   xmm_out = _mm_add_ss(xmm_veca,xmm_vecb); 
   _mm_store_ss(&out[2],xmm_out); 
#else 
   out[0] = veca[0]+vecb[0]; 
   out[1] = veca[1]+vecb[1]; 
   out[2] = veca[2]+vecb[2]; 
#endif 
} 

void VectorCopy (vec3_t in, vec3_t out) 
{ 
#if _MSC_VER 
   // raynorpat: msvc sse optimization 
   __m128 xmm_in; 

   xmm_in = _mm_load_ss(&in[0]); 
   _mm_store_ss(&out[0],xmm_in); 

   xmm_in = _mm_load_ss(&in[1]); 
   _mm_store_ss(&out[1],xmm_in); 

   xmm_in = _mm_load_ss(&in[2]); 
   _mm_store_ss(&out[2],xmm_in); 
#else 
   out[0] = in[0]; 
   out[1] = in[1]; 
   out[2] = in[2]; 
#endif 
} 

void VectorScale (vec3_t in, vec_t scale, vec3_t out) 
{ 
#if _MSC_VER 
   // raynorpat: msvc sse optimization 
   __m128 xmm_in, xmm_scale, xmm_out; 

   xmm_in = _mm_load_ss(&in[0]); 
   xmm_scale = _mm_load_ss(&scale); 
   xmm_out = _mm_mul_ss(xmm_in,xmm_scale); 
   _mm_store_ss(&out[0],xmm_out); 

   xmm_in = _mm_load_ss(&in[1]); 
   xmm_scale = _mm_load_ss(&scale); 
   xmm_out = _mm_mul_ss(xmm_in,xmm_scale); 
   _mm_store_ss(&out[1],xmm_out); 

   xmm_in = _mm_load_ss(&in[2]); 
   xmm_scale = _mm_load_ss(&scale); 
   xmm_out = _mm_mul_ss(xmm_in,xmm_scale); 
   _mm_store_ss(&out[2],xmm_out); 
#else 
   out[0] = in[0]*scale; 
   out[1] = in[1]*scale; 
   out[2] = in[2]*scale; 
#endif 
} 

void VectorConstruct(float vec1, float vec2, float vec3, vec3_t out)
{
#if _MSC_VER 
	// raynorpat: msvc sse optimization 
	__m128 xmm_in; 
	
	xmm_in = _mm_load_ss(&vec1); 
	_mm_store_ss(&out[0],xmm_in); 
	
	xmm_in = _mm_load_ss(&vec2); 
	_mm_store_ss(&out[1],xmm_in); 
	
	xmm_in = _mm_load_ss(&vec3); 
	_mm_store_ss(&out[2],xmm_in); 
#else 
	out[0] = vec1;
	out[1] = vec2;
	out[2] = vec3;
#endif 
}
Productivity is a state of mind.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Re: qbismSuper8 builds

Post by leileilol »

fog could certainly use asm treatment (slowest thing in qbism right now). hell i'd like more asm in everything in general

especially for the functions D_DrawSurfaceBlock8RGBHQ_mip0, D_DrawSurfaceBlock8RGBHQ_mip1, D_DrawSurfaceBlock8RGBHQ_mip2 and D_DrawSurfaceBlock8RGBHQ_mip3 and I wonder if we can get a _mip4 just for drawing one texel per unblended light texel for Descent-style flat'ing

it's funny how in dec 2009-jan 2010 everyone was so apathetic about software engines not ever relevant to have QSB features as if there was no hope in them at all. and now we have lits and fog and alphas out the wazoo.....lol, the software renaissance should have happened years ago


Does func_ know about qbismsuper8?
i should not be here
qbism
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am
Contact:

Re: qbismSuper8 builds

Post by qbism »

performance: I used this short demo made in an area of saint.bsp with lots of geometry http://super8.qbism.com/wp-content/uplo ... ontest.zip
Console 'cl_showfps 1' or 'timedemo hontest'

asm fog: Short of asm fog, maybe depth check could skip every 2 or 4 pixels; fog doesn't have to be precise. Maybe there's already a similar depth check in existing Quake asm functions.

color: super8 color is a minimal performance hit. It's running a second blocklights (blockcolors) and another lookup table blend in the mips functions, that's about it. The price is a lack of blending between color blocks, usually hidden but sometimes exposed at high contrast boundaries. For the super8 aesthetic, exposure of "how things are made" is acceptable. An hq asm option... that's something beautiful that should be brought into existence by... somebody. Was this ever attempted, asm or not, in an 8-bit engine prior to engoo?

renaissance: Much of the software interest revived with desire to port to 8-bit devices w/o 3D hardware (Dreamcast, DOS, Pocket PC, EGA 486 ThinkPad...). My own porting goals died as the machines died one-by-one through 2010 and 2011. But the tech goal had also become an aesthetic goal. It might take a big mod or TC project geared toward software rendering to really free it from apathy.

func: Haven't really promoted super8 at func yet, but a few of the more skilled and discerning mappers are aware. :wink:

CPU-specific math: I'm going to check that out!
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: qbismSuper8 builds

Post by revelator »

If you are going to use the sse functions i posted replace the _MSC_VER with __SSE__ and add __SSE__ to the compiler defines in codeblocks build options (translates to -D__SSE__) :) else it only works if your compiler is msvc. Used it on realm and noticed a slight speedup so going to do a timedemo later today.
Productivity is a state of mind.
revelator
Posts: 2621
Joined: Thu Jan 24, 2008 12:04 pm
Location: inside tha debugger

Re: qbismSuper8 builds

Post by revelator »

it does run faster but hard to tell by how much on my pc since its allready hitting hard on the speed limits.
does not affect load times though.
Productivity is a state of mind.
Post Reply