eWallRim::Bound
- Z-Man
- God & Project Admin
- Posts: 11770
- Joined: Sun Jan 23, 2005 6:01 pm
- Location: Cologne
- Contact:
Two reasons it's not in CVS:
a) it's a CPU hog
b) the "lighting" effect is not even remotely correct
But if it's disabled by default and the config item enabling it is well hidden (so users don't activate it, thinking its a fully supported feature, and complain about a) or b) ), I have no objections.
a) it's a CPU hog
b) the "lighting" effect is not even remotely correct
But if it's disabled by default and the config item enabling it is well hidden (so users don't activate it, thinking its a fully supported feature, and complain about a) or b) ), I have no objections.
- Tank Program
- Forum & Project Admin, PhD
- Posts: 6715
- Joined: Thu Dec 18, 2003 7:03 pm
Jonathan, the things in front (if they are lights) should continue to spread out at the end of the wall due to wave properties. More specific, the light should defract and continue to loose strength. (The lack of this is most visible in the upper left corner of the screen shot you posted, where whites light stops at the wall, and at the end of the wall does not diffract.)
Edit: Following up on this, the waves should also reflect some if the walls are a reflective surface...
Edit: Following up on this, the waves should also reflect some if the walls are a reflective surface...

- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
- Z-Man
- God & Project Admin
- Posts: 11770
- Joined: Sun Jan 23, 2005 6:01 pm
- Location: Cologne
- Contact:
Jonathan:
I read from the FPS count that you circumvent 1) by casting less rays. And the lighting effect looks a lot better, although it's still not proper (the light would need to get blended with the surface it shines on and the walls would need to get light, too).
Cool deathzone
Tank: No game handles light diffraction correctly, especially the kind you're talking about. Mainly because it only has visible effect when the lit structures are very small. Soft shadow edges as you get them from lightsources with finite extension would be cool, though.
Cool deathzone
Tank: No game handles light diffraction correctly, especially the kind you're talking about. Mainly because it only has visible effect when the lit structures are very small. Soft shadow edges as you get them from lightsources with finite extension would be cool, though.
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
Yep, only 33. Still slow with nemo though.z-man wrote:Jonathan:I read from the FPS count that you circumvent 1) by casting less rays.
Would be hard to fix... I'll think about it.And the lighting effect looks a lot better, although it's still not proper (the light would need to get blended with the surface it shines on and the walls would need to get light, too).
Edit: do you suspect anything is wrong with the way I calculate brightness? Keep in mind that the light is positioned only 1 unit above the floor.
And the winzone is green.Cool deathzone
Last edited by Jonathan on Mon May 30, 2005 6:23 pm, edited 1 time in total.
ˌɑrməˈɡɛˌtrɑn
- LETE
- Core Dumper
- Posts: 128
- Joined: Sat May 21, 2005 5:40 am
- Location: Hey if i'm not here i'm most likely on the grid
- Tank Program
- Forum & Project Admin, PhD
- Posts: 6715
- Joined: Thu Dec 18, 2003 7:03 pm
- LETE
- Core Dumper
- Posts: 128
- Joined: Sat May 21, 2005 5:40 am
- Location: Hey if i'm not here i'm most likely on the grid
In that case, its impossible for each light to be white at its origin, that implies that about 6 feet down the line your filtering out all of the visual spectrum except for the color of the cycle/trail. it really should be the same color all the way to the origin for the light source. BTW, can you post the code changes you've made thus far? And maybe the code you use for the win zone while your at itJonathan wrote:LETE: Of course! But trying to make it more accurate is fun.

- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
Not so clean, but here it is anyway:
Edit: this fragment program is faster than the one on the screenshots, which did some stuff that is unnecessary in this case.
Code: Select all
if(headlights) {
if(!cycleprograminited) { // set to false on every sr_InitDisplay, without it I lost my program when I switched to windowed
const char *program =
"!!ARBfp1.0\
\
PARAM normal = program.local[0];\
ATTRIB texcoord = fragment.texcoord;\
TEMP final, diffuse, distance;\
\
DP3 distance, texcoord, texcoord;\
RSQ diffuse, distance.w;\
RCP distance, distance.w;\
MUL diffuse, texcoord, diffuse;\
DP3 diffuse, diffuse, normal;\
MUL final, diffuse, distance;\
MOV result.color.w, fragment.color;\
MUL result.color.xyz, fragment.color, final;\
\
END";
glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(program), program);
cycleprograminited = true;
}
glProgramLocalParameter4fARB(GL_FRAGMENT_PROGRAM_ARB, 0, 0, 0, speed * speed, 0);
glPushAttrib(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // blend func and depth mask. Efficient or not, glPushAttrib/glPopAttrib is a quick way to manage state.
glEnable(GL_FRAGMENT_PROGRAM_ARB); // doesn't check if it exists...
const unsigned sensors = 32; // actually one more
const double mul = 0.25 * M_PI / sensors;
const double add = -0.125 * M_PI;
double size = gArena::SizeMultiplier() * 500 * M_SQRT2; // is M_SQRT2 in your math.h?
GLfloat array[sensors+2][5];
array[0][0] = 0;
array[0][1] = 0;
array[0][2] = p.x;
array[0][3] = p.y;
array[0][4] = 0.125;
for(unsigned i=0; i<=sensors; i++) {
gSensor sensor(this, p, dir.Turn(cos(i * mul + add), sin(i * mul + add)));
sensor.detect(size);
array[i][5] = sensor.before_hit.x - p.x;
array[i][6] = sensor.before_hit.y - p.y;
array[i][7] = sensor.before_hit.x;
array[i][8] = sensor.before_hit.y;
array[i][9] = 0.125;
}
glPushMatrix();
glLoadIdentity();
glMatrixMode(GL_TEXTURE);
glPushMatrix();
glTranslatef(0, 0, 1);
glBlendFunc(GL_ONE, GL_ONE);
glDepthMask(GL_FALSE);
glColor3fv(reinterpret_cast<GLfloat *>(&color_)); // 8-)
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_TEXTURE_COORD_ARRAY);
glInterleavedArrays(GL_T2F_V3F, 0, array);
glDrawArrays(GL_TRIANGLE_FAN, 0, sensors+2);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisable(GL_FRAGMENT_PROGRAM_ARB);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
glPopAttrib();
}
Last edited by Jonathan on Tue May 31, 2005 4:30 am, edited 1 time in total.
ˌɑrməˈɡɛˌtrɑn
- Jonathan
- A Brave Victim
- Posts: 3391
- Joined: Thu Feb 03, 2005 12:50 am
- Location: Not really lurking anymore
The zone (add any missing instance variables to the class):
Call these in constructors and destructors:
That's how I left it a while ago...
Note that s_zoneDeath is int.
Code: Select all
void gWinZone::Render(const eCamera *cam)
{
lastTime = se_GameTime();
#ifndef DEDICATED
glDisable(GL_LIGHTING);
glDisable(GL_CULL_FACE);
glDisable(GL_TEXTURE_2D);
double r = Radius();
GLfloat m[16] = {
r,0,0,0,
0,r,0,0,
0,0,pow(fabs(r), 1/M_E),0, // e doesn't mean much here, but it works pretty well
pos.x,pos.y,0,1
};
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glMultMatrixf(m);
glCallList(dlbase + s_zoneDeath);
glPopMatrix();
#endif
}Code: Select all
void gWinZone::GenerateLists() {
const unsigned int detail = 1024;
const double dinc = 2*M_PI/detail;
unsigned int i;
double d = 0;
dlbase = glGenLists(2);
float x[detail+1], y[detail+1];
for(i=0; i<=detail; i++) {
x[i] = cos(d);
y[i] = sin(d);
d += dinc;
}
glNewList(dlbase, GL_COMPILE);
glBegin(GL_QUAD_STRIP);
for(i=0; i<=detail; i++) {
glColor3f(0.0, 1.0, 0.0);
glVertex3f(x[i], y[i], 1.0);
glColor3f(0.25, 1.0, 0.25);
glVertex3f(x[i], y[i], 0.0);
}
glEnd();
glEndList();
glNewList(dlbase + 1, GL_COMPILE);
glBegin(GL_QUAD_STRIP);
for(i=0; i<=detail; i++) {
glColor3f(1.0, 0.0, 0.0);
glVertex3f(x[i], y[i], 1.0);
glColor3f(1.0, 0.25, 0.25);
glVertex3f(x[i], y[i], 0.0);
}
glEnd();
glEndList();
}
void gWinZone::DeleteLists() {
glDeleteLists(dlbase, 2);
}Note that s_zoneDeath is int.
ˌɑrməˈɡɛˌtrɑn