User panel stuff on forum
  36 posts on 2 pages  First page12Last page
Client Talk
2009-03-07, 11:28
Member
60 posts

Registered:
Apr 2006
I'm new to programming in QW but I thought I'd try setting up glsl in ezq. Here's a screen of the rl toon shaded (diffuse+spec):

The map is also multi-textured in glsl. I'm blending the map textures with the light-maps.

*UPDATE (March 09 - 6:30pm)

Movie here

http://img510.imageshack.us/img510/6995/ezqtoonshadeoutline2.png


Toon Shade + Outline + Greyscale Texture (PrimeEvil):

Movie here

http://img13.imageshack.us/img13/9072/ezqtoonshadetexture.jpg



**UPDATE (April 02)

Texture-less colored models with bump mapped floors/walls

http://img7.imageshack.us/img7/424/ezqtooncolor.png
2009-03-07, 12:28
Member
705 posts

Registered:
Feb 2006
Where's the patch?
2009-03-07, 12:47
Member
60 posts

Registered:
Apr 2006
I'd like to do more before I release this to the public. Just thought I'd get some feedback.
2009-03-07, 12:56
Member
51 posts

Registered:
Sep 2006
Rapidshare is not nice if you don't have an account, took forever to download just 16mb just because of their limits, and then the video doesn't work in VLC (this is my fault though, should have read a little what you wrote!).

But from the screens it looks interesting, in the first screenshot the map looks very bright, but it seems to be fixed in the second if that is an update from the first.
2009-03-07, 13:08
Member
60 posts

Registered:
Apr 2006
Yeah rapidshare sux, my apologies. The first screen I just had the gl_contrast set really high.

The light position is at the entity pos with maybe a slight offset (i can't remember.) I think toon shading and cell shading would be easy to implement in the ezquake framework (i think i'm at least 75% there) for setting player and other entity colors which is why I started with it and it doesnt really need any special lighting. It's also not too bad on the framerate. I have a bunch of ideas on how to make shaders agreeable in ezquake such as making more complex shaders that involve lots of lighting calculations more geared towards spec mode and movie dev until they are optimized enough for decent frame rates. Toon-shading would be fine for gameplay
2009-03-07, 16:55
Member
1102 posts

Registered:
Jan 2006
For file hosting there is http://www.quaketastic.com (pw: ilovetheshubhub)

Looks awesome, keep up the great work!
2009-03-07, 18:54
Member
113 posts

Registered:
Apr 2006
ruskie wrote:
Where's the patch?

qqshka did some glsl implementation work in december I think, the foundation should already be in trunk. See revision r3863.
biomass
2009-03-07, 20:13
Member
60 posts

Registered:
Apr 2006
Cool thanks Spirit

HQ version of the mov (.wmv/292kb) here

ruskie / biomass:

Sadly you won't get too far with that. That implementation qqshka did is just a basic setup for glsl scripting any glsl programmer can slap together in 5 min. It's not integrated into ezquake's graphic pipeline so I wouldn't even call it "implemented." The legwork is still left up to you for getting shaders properly working in ezquake. It's like me including say a matrix library and saying I implemented a matrix lib into ezquake.
2009-03-07, 23:23
Member
51 posts

Registered:
Sep 2006
Nice video, maybe you could add some black edges like on weapons in Warsow, and use some texture instead of just one color? Just some ideas.


Would it be possible to add water shaders like:
http://forums.inside3d.com/viewtopic.php?t=797 (thread with dead links, some screens on page 2 though)
http://www.quaketastic.com/upload/files/misc/dp_pretty_water_0.2.zip (download link)
2009-03-07, 23:26
Member
793 posts

Registered:
Feb 2006
what ís glsl?

i like how this looks. it's fitting for qw because many players prefer fullbright an monochrome optics for a lot of stuff. ths cell shading or whatever is a nice way to still have it look cool.
2009-03-08, 00:32
Member
113 posts

Registered:
Apr 2006
GL (as in OpenGL) Shader Language - Wikipedia
biomass
2009-03-08, 00:44
Member
113 posts

Registered:
Apr 2006
oneshotflinch wrote:
Sadly you won't get too far with that. That implementation qqshka did is just a basic setup for glsl scripting any glsl programmer can slap together in 5 min. It's not integrated into ezquake's graphic pipeline so I wouldn't even call it "implemented." The legwork is still left up to you for getting shaders properly working in ezquake. It's like me including say a matrix library and saying I implemented a matrix lib into ezquake.

Sorry but our GLSL team was on vacation for god knows how long so they didn't have time to take a look at it
I think that the idea that was tossed around at the time was to replace some of the existing effects with a glsl equivalent and perhaps have the users create their own effects along side the engine (I don't have a clue as to how this would work though).
biomass
2009-03-08, 01:02
Member
793 posts

Registered:
Feb 2006
thanks biomass
2009-03-08, 01:19
Member
60 posts

Registered:
Apr 2006
Yeah that's cool. Yeah my idea is to expose the scripts to users and expose as much necessary data as uniforms from the engine possible in all the scripts so users can rewrite the scrips as they wish. Also for texture sampling do the standard _norm _gloss as well as _toon _mtex_1, etc. extensions for loading textures into the shaders. If the uniforms aren't used they can just be ignored (left alone) in the script..

Toon colors could also be defined from cvars:

glsl_enable = "1";
glsl_toonshading = "1";
glsl_toon_enemycolor "0.8 0.0 0.0 1.0"; //red r/g/b/a
glsl_toon_teamcolor "0.8 0.8 0.8 1.0"; //grey/white r/g/b/a
glsl_toon_rlcolor "0.8 0.8 0.0 1.0"; // yellow r/g/b/a
etc.

This is the simplest and most flexible integration I could think of for now. In Q3 you can setup shaders in a material definition script for each texture, which would also be cool approach to consider:

qw/textures/shaders/toonmap.bmp
{
spec = 8.0;
glow = 0.5;
etc.
}

Guran: Thanks. I like thick outlines/ strokes as well. That's gonna be my next shader effect. I'll post a screen when it's done Using textures with shader is easy, you just multiply the texture coord by the frag color. It doesn't look good with default qw textures. It would be better to make custom textures for toon shading like warsow did.
2009-03-08, 01:40
Member
252 posts

Registered:
Dec 2006
Would it be possible to interpolate the jaggedness of lights in ezquake, without significant performance hit?
'on 120 ping i have beaten mortuary dirtbox and reload' (tm) mz adrenalin
'i watched sting once very boring and not good at all' (tm) mz adrenalin
[i]'i shoulda won all
2009-03-08, 05:55
Member
60 posts

Registered:
Apr 2006
A very good question. I'm still looking into how to properly approach lighting...i mentioned earlier i'm new to programming in qw so i don't have all the answers yet. I'm assuming you mean dynamic lighting techniques - per pixel vs vertex lighting. Once I delve deeper into that area of the code I'll figure out some optimized way of approaching this The way I'm toon shading is I'm using a virtual light pos at the entity pos so lighting is a non-issue and the perf is fine. It might be a case where some of the more advanced lighting type shaders is only good for spec/demo view/movie dev and the optimizations come later.
2009-03-09, 02:20
Member
60 posts

Registered:
Apr 2006
Toon Shade + Outline + Greyscale Texture (PrimeEvil):

http://img13.imageshack.us/img13/9072/ezqtoonshadetexture.jpg


Movie here

( Looks way better in-game, a lot of quality is lost converting video ;( )
2009-03-09, 16:03
Member
251 posts

Registered:
Jul 2007
Sweet.
2009-03-09, 16:26
Member
51 posts

Registered:
Sep 2006
Making some progress here
I cant see the outline on the model though, very thin?
2009-03-09, 22:19
Member
60 posts

Registered:
Apr 2006
Guran, you are right, it's difficult to see because the movie quality sux which is partially why it's not so visible. I made the outline thicker and non-gradient. Higher quality image:

http://img510.imageshack.us/img510/6995/ezqtoonshadeoutline2.png


Movie here ( Quality still sux ;( )
2009-03-09, 22:48
Administrator
1864 posts

Registered:
Feb 2006
nicely done!

Now go add proper md3 support to ezQuake
2009-03-10, 01:11
Member
60 posts

Registered:
Apr 2006
http://img229.imageshack.us/img229/8904/q1ranger01lw8.jpg


*Drool*
2009-03-10, 10:10
Administrator
1864 posts

Registered:
Feb 2006
exactly, but it will never happen unless md3 support in ezQuake is fixed
2009-03-10, 17:47
Member
51 posts

Registered:
Sep 2006
Much better outline, and the video doesn't lag.
Got any more plans for your toon shading?

ezQuake would need some upgrades if it would want to compete with modern engines, right now it's stuck somewhere in 1998/99 (HL, Q3) with buggy bloom support, but GLSL is definitely a way in the right direction. On the other hand ezQuake have a lot of great gameplay features to mention something positive.
2009-03-13, 17:54
Member
60 posts

Registered:
Apr 2006
"Got any more plans for your toon shading?"

Yes, I'm working on a bunch of stuff. Multi-tasking between effects as well as totally revamping my original code. QW coding hasn't so fun for me because it's old structural c. However I am getting into the swing of it now that I have a solid glsl setup
2009-04-03, 07:41
Member
60 posts

Registered:
Apr 2006
I made it so you can change all the model colors with cvars. For fast realtime lookups I gave all the models Ids at load time (like modhint.)

http://img7.imageshack.us/img7/424/ezqtooncolor.png
2009-04-03, 10:10
Administrator
1864 posts

Registered:
Feb 2006
Haha thats really nice oneshotflinch, then we don't even need to use one colored textures anymore
2009-04-03, 16:39
Member
60 posts

Registered:
Apr 2006
Yup, there's no textures on models in that sshot
2009-04-14, 02:39
Member
357 posts

Registered:
Mar 2006
Here's a quick celshading demo in immediate mode opengl v1.3

http://www.quakeone.com/qrack/qrack_celshading.avi (2Mb)

Can the GLSL use existing textures?
2009-04-15, 05:33
Member
60 posts

Registered:
Apr 2006
Here's how I have it setup now, although if time permits to improve this method or the rest of the team has me do it different this is how it works.
// cvar that forces glsl to be in effect so long as video card/drivers supports it
glsl_enabled "1"
// example modes are "toon" "bump" "glow" "normal"
glsl_bmodel_mode "bump" //bmodels
glsl_vmodel_mode "bump" //vmodels
glsl_model_mode "bump" //mdl,md3 etc
glsl_map_mode "bump" //bsp map

glsl_specular "1"

Here's a breakdown of how bsp map mode "bump" would work:

Check if glsl_enabled is 1 (also if ok with video card/drivers), if 1 continue else default to open-gl rendering. check if deluxe and normal tex loaded if so continue else default to "normal" mode (base texture blended with light-map and possibly luma if enabled and luma tex loaded.) if continue then check if glsl_specular is 1 and gloss map loaded else do bump without gloss. The engine will pass to the shader which rendering mode can be done based on the cvar settings and which textures were present to be loaded.

glsl_bmodel_mode "toon" //bmodels
glsl_vmodel_mode "toon" //vmodels
glsl_model_mode "toon" //mdl,md3 etc
glsl_map_mode "toon" //bsp map

glsl_toon_texture "1"
glsl_toon_outline "1"

In the toon mode shaders if glsl_toon_texture is "1" then the texture color will be added to the toon color. Inside the shader I have setup a function so you can REPLACE, MODULATE, DECAL, BLEND, ADD, SUBTRACT or COMBINE the color with the texture color. Infact you can rewrite the shader completely if you want to be creative and come up with your own toon shader. If glsl_toon_outline is 1 then an outline will be also rendered.
  36 posts on 2 pages  First page12Last page