|
|
|
Member 357 posts
Registered: Mar 2006
This code outlines the models with a THIN black line, like a cartoon effect. /* R_DrawAliasOutlineFrame */
void R_DrawAliasOutlineFrame (aliashdr_t *paliashdr, int pose1, int pose2, qbool mtex, qbool scrolldir) { int *order, count; vec3_t interpolated_verts; float lerpfrac; trivertx_t *verts1, *verts2;
if (r_modelalpha < 1) return;
glCullFace (GL_BACK); glPolygonMode (GL_FRONT, GL_LINE);
glLineWidth (1.0f);
glColor4f (0.0f,0.0f,0.0f,1); glEnable (GL_LINE_SMOOTH); glDisable (GL_TEXTURE_2D);
lerpfrac = r_framelerp; lastposenum = (lerpfrac >= 0.5) ? pose2 : pose1;
verts2 = verts1 = (trivertx_t *) ((byte *) paliashdr + paliashdr->posedata);
verts1 += pose1 * paliashdr->poseverts; verts2 += pose2 * paliashdr->poseverts;
order = (int *) ((byte *) paliashdr + paliashdr->commands);
for ( ;; ) { count = *order++; if (!count) break;
if (count < 0) { count = -count; glBegin(GL_TRIANGLE_FAN); } else glBegin(GL_TRIANGLE_STRIP);
do { order += 2;
if ((currententity->renderfx & RF_LIMITLERP)) lerpfrac = VectorL2Compare(verts1->v, verts2->v, r_lerpdistance) ? r_framelerp : 1;
VectorInterpolate(verts1->v, lerpfrac, verts2->v, interpolated_verts); glVertex3fv(interpolated_verts);
verts1++; verts2++; } while (--count);
glEnd(); }
glColor4f (1, 1, 1, 1); glPolygonMode (GL_FRONT, GL_FILL); glDisable (GL_LINE_SMOOTH); glCullFace (GL_FRONT); glEnable (GL_TEXTURE_2D); } called in R_SetupAliasFrame, ... GL_DrawAliasFrame (paliashdr, oldpose, pose, mtex, scrolldir); if (r_outline.integer) R_DrawAliasOutlineFrame(paliashdr, oldpose, pose, mtex, scrolldir); }
Administrator 888 posts
Registered: Jan 2006
Sounds interesting! But I would need a more explained walkthrough than this to even try it. Join us on discord.quake.world
Member 186 posts
Registered: Jan 2008
Member 192 posts
Registered: Mar 2006
Administrator 1025 posts
Registered: Apr 2006
It depends on globals etc, so what engine is it made for?
Member 357 posts
Registered: Mar 2006
That above code plugs into ezQuake. The outlines are black, though like in Warsow, can be colored the team color. There's nothing fancy about the code, other than just redrawing the model as a wireframe and culling the areas already drawn, so all you end up seeing is just the outer edges. And on machines of today, this doesnt really lose many fps. heres what it looks like
Administrator 1864 posts
Registered: Feb 2006
Btw, what happened to the cell-shading someone was doing for ezQuake?
Member 628 posts
Registered: Jan 2006
i want this, and i want this for EDGES !
Member 357 posts
Registered: Mar 2006
Lol I started thinking, what is "EDGES"? Then I looked at your pic again and saw u drew over the edges of the map. Ya this is also do-able...just ran through the surface routine instead of alias models.
I can post cel shading code later, it wont use GLSL like someone once posted pics of but runs fast enough if your card was made since 2005.
Member 1026 posts
Registered: Feb 2006
this is a pretty good idea, but if you choose to add black edges to map i think it's better to have 2 variables: one for entity (player models, items) outlines, one for map outlines
Member 231 posts
Registered: Jan 2006
could be nice
Administrator 1265 posts
Registered: Jan 2006
looking forward for this! with some "flat" textures, the visuals would change alot! never argue with an idiot. they'll bring you back to their level and then beat you with experience.
Member 123 posts
Registered: Mar 2006
I think this is mainly a NQ thing, they are OK with outlines but don't like skins. Go figure.
Member 357 posts
Registered: Mar 2006
NQ players are a little more "touchy " about things like this, which is why in NQ I use team colored outlines that are affected by world lighting, meaning in dark areas (dm2 corner) the outlines dont glow in the dark! But black doesnt have this condition and is faster to render. For dual cvar, it wouldnt be needed, just r_outline 1 = players/items only r_outline 2 = all including world. r_outline 3 could be just world outlines solely.
Member 76 posts
Registered: Oct 2009
Nvm, havent checked images,
(Edited 2012-04-24, 10:41)
Administrator 1864 posts
Registered: Feb 2006
I can post cel shading code later, it wont use GLSL like someone once posted pics of but runs fast enough if your card was made since 2005. Bring the code already!
Member 375 posts
Registered: Sep 2009
WTFFFF!!! VERY NICE!!!!! using with proper(or NO) textures would improve AIM a lot!
I downloaded the source-code of ezquake, but which .c do I insert this, and where?
share some "howto", please!!!
(Edited 2012-06-06, 01:04) (QW Nickname: AL.Kernell)
Member 628 posts
Registered: Jan 2006
wernerml, its already coded into ezquake in the newest beta release, r_* commando to enable it i think.
Member 375 posts
Registered: Sep 2009
NICE, got it: r_outline, with the Nighlty Build version! at small distances it's very nice, but to be nice with far distances I had to set: r_outline_width 1 (instead of 2)
now the most amazing would be this working with the whole MAP!!! (QW Nickname: AL.Kernell)
Member 124 posts
Registered: Apr 2012
Looks really nice :>
An observation that... probably needs fixing, though?
Using Carmack's trick to not clear the zbuffer (gl_ztrick), you can actually see the outlines of armors/players through walls at short distances (like around corners) if your cl_maxfps is a high enough value. It'll flicker enough to be noticeable.
Tested in Linux, but it should be the exact same for other platforms. Why not ditch gl_ztrick altogether in the ezquake code? It's kind of pointless on modern video cards. :p
Moderator 383 posts
Registered: Jan 2006
Last nightly build does not have this commands.
Moderator 383 posts
Registered: Jan 2006
.
(Edited 2012-07-02, 03:04)
Member 18 posts
Registered: Aug 2006
So its not fix'ible with 2.1 Stable Version (build 3330) ? We cant add the r_outline and gl_outline (for console settings) to other versions? Im no hacker and do not understand much of this things, but If its able to fix the skins like in the pic I would love to have that information (msg me plz). :{ feel abit ashame since I feel I dont know what im talking about. :{ peace!
Member 357 posts
Registered: Mar 2006
With fullbright skins in QW i really dont think outlines would be much of a benefit. The fullbright colors out-wash the outlines.... plus fb_skins render faster than outlines.... The screenshots u see in this post do not use fullbright skins. I guess its just a matter of preference but, after almost a year later in retrospect this feature is kinda useless
Member 132 posts
Registered: Apr 2007
but it looks so gooood.. -________-
|
|
|
|