#uwadv@irc.freenode.net logs for 16 Jan 2003 (GMT)

Archive Today Yesterday Tomorrow
Underworld Adventures homepage


[00:00:26] <Servus> im not sure about OpenGL Proper, but i believe you simply turn on SHADE_GOURAUD and render the entire smooth-group as a triangle fan(?)
[00:00:36] <vividos> my problem probably is now knowing what smooth groups are :)
[00:00:37] <Servus> or if they share one material, they'll smooth, or somesuch
[00:01:30] <Servus> if a bunch of faces are in the same 'smooth group' they will have smooth lighting interpolated between all triangles, so that a sharp 90' edge will appear to be smoothed and rounded off
[00:02:12] <wjp> time for me to go; g'night
[00:02:20] <-- wjp has left IRC ("Zzzz...")
[00:02:21] <Servus> you know gouraud shading right? smooth groups just tell the renderer not to gouraud shade everything together, but to leave sharp lines between smooth-groups and to make everything else smooth... goodnight wjp
[00:03:54] <vividos> ah ok
[00:06:23] <Servus> can you see it? what software do you need to view .wrls again? just loading in IE doesnt work :0
[00:07:08] <vividos> I look at it with a text editor :)
[00:07:28] <Servus> i might have a 3d model of a huge penis and you'd never know, then
[00:07:34] <vividos> there may be a wrl viewer, but I directly try to load it and render it via OpenGL
[00:08:05] <Eldron> "Im finished with the model of my mighty virtous two handed sword!"
[00:08:14] <Servus> .wrl is what is often used for in-webpage 3d graphics... real 3d graphics, i mean
[00:08:31] <Servus> is that a double entendre eldron? if not, lemme see:)
[00:08:43] <Eldron> heh
[00:09:50] <vividos> :)
[00:38:58] --> Telemachos has joined #uwadv
[00:38:58] --- ChanServ gives channel operator status to Telemachos
[00:39:02] <Telemachos> evening
[00:40:22] <vividos> hi Telemachos
[00:40:52] <vividos> your tutorial chapter on flex helped a bit
[00:41:07] <Telemachos> just read over the logs and thought I would pop in and help you out with the smoothing group problem if you havent fixed it ;)
[00:41:16] <Telemachos> great .. good it was of some use
[00:41:34] <vividos> oh, and btw, http://www.peroxide.dk/era/ doesn't work in opera :)
[00:41:59] <vividos> well, the smooth groups don't get exported into wrl
[00:42:08] <Telemachos> no we know ;) Its quite messed up in opera :)
[00:42:33] <Telemachos> bugger.. they are *really* important actually.. the models will look like crap without :(
[00:42:48] <Eldron> they are that important? :x
[00:42:52] <vividos> in IE it works; I like the split design
[00:43:08] <Telemachos> are you sure they are not in the wrml format? They are even exported in the simple ASC format (also an ascii format)
[00:43:16] <vividos> (the website, I meant)
[00:43:20] <Eldron> I thought most games.. older that is use just gourad shading all around..
[00:43:26] <Eldron> for an object that is..
[00:43:27] <Telemachos> yeah I kinda like it too ;)
[00:43:50] <Telemachos> smoothing groups has nothing to do with the shading actually.. it works "on top" of gouraud shading
[00:43:54] <vividos> for the smooth groups .. I didn't see them in vrml yet
[00:44:06] <Telemachos> hmm.. let me see if I can find some good example of what they do..
[00:46:37] <Telemachos> take a look at this oooold screenshot and look at the legs of the table: http://www.peroxide.dk/ultima/screenshot01.htm
[00:46:56] <Telemachos> notice how there is a very "sharp" transition from lit to unlit around the edges?
[00:47:54] <Telemachos> You know that normally to do smooth gouraud shading you would set the vertex normal to the average of the face normals of the triangles it is used in?
[00:48:18] <Telemachos> that way the edge between the two triangles will be smoothed out and the object will appear round..
[00:49:11] <vividos> yes
[00:49:39] <Telemachos> but if you apply that technique to, say, the 8 vertices in a box then the corners would seem "rounded" too..
[00:50:08] <Telemachos> and the lighting around the edges would be too smooth.. there you would want a sharp transition in light - just like those legs on that table I showed
[00:50:11] <Servus> telemachos, in direct3d, smoothing groups determine how gouraud shading is implemented
[00:50:28] <Servus> all those models are so simple that they use a single smooth group :)
[00:50:42] <Servus> well except for stuff with sharp edges, like the fountain and the candle, they have special smooth groups
[00:50:43] <Telemachos> so to know WHICH faces to include when you calculate the vertex normal the artist split the geometry up into smoothing groups..
[00:51:19] <Telemachos> so for a box each side would have its own smoothing group right?
[00:51:35] <Servus> yep, otherwise its gonna be a Nerf box
[00:51:41] <vividos> ah ok
[00:51:59] <Servus> for stuff like a simple box, it's simple to have no smooth groups at all
[00:52:02] <Telemachos> but that gives problems.. because in max each vertex can have many normals.. so the 3d *point* location might only be stored once..
[00:52:30] <Telemachos> but you need a copy of the 3d point for each different normal because thats how it works in d3d or openGL
[00:52:44] <Servus> 3dmax's .wrl export dialog has tons of options...
[00:52:58] <Telemachos> so you might have to dublicate certain points.. for the box you WOULD actually need 24 different vertices to get good lighting
[00:53:10] <Servus> and ive an extremely complicated model directly from 3dmax into direct3d and it looked JUST like 3dmax:)
[00:53:23] <Servus> stick the word "exported" into that sentence ^^^
[00:53:50] <Servus> and telemachos, not if you render it as a flat-shaded triangle fan :)
[00:54:20] <Servus> then its 14 vertices, i think
[00:54:46] <Telemachos> Servus - quite frankly, you don't know what your talking about ;) just let me explain this to Vividos and then we can discuss it if you want ok ? ;)
[00:55:18] * Servus . o O ( id show you another demo but then you'd change the point again ;)
[00:56:00] <Telemachos> Anyway - what you must do to calculate vertex normals is simply to only average over triangles that belongs to the same smoothing group
[00:56:29] <Telemachos> and then watch out if you need to dublicate vertices on the borders between different smoothing groups ;)
[00:57:22] <Eldron> all this tech-talk gives me a headache.. I'll go finish the gazer x_x
[00:57:28] <vividos> does every vertex in a smoothing group have the same normal vector then?
[00:57:57] <Telemachos> no, because the part of the model in a certain smoothing group isnt nessesarily planar
[00:58:03] * Servus . o O ( the .x file format gives full 3dmax information )
[00:58:31] <vividos> but it depends on the triangle the vertex is in?
[00:58:53] <Telemachos> the easiest way to understand them is to think of the box example.. there, to get correct light, you would need several different normal directions for each "point"
[00:59:03] * Servus wonders if telemachos honestly renders everything as a triangle list :-O
[00:59:43] <Telemachos> yes.. each vertex normal is calculated from the *face* normals of the triangles in which it appears
[00:59:59] <Telemachos> but only from those faces in the same s-group
[01:00:34] <vividos> ah ok. if a vertex is used by two faces, the two face normals are averaged and used for that vertex, right?
[01:00:42] <Telemachos> exactly
[01:01:04] <vividos> ok
[01:01:29] <Telemachos> so *if* a box had just one s-group... then each of the 8 vertices would have a normal looking like an antenna comming out the top of a pyramid.. the pyramid defined by the corner
[01:01:55] <Telemachos> which would in turn smooth out the lighting and make the boxes corners look dull and round
[01:02:49] <vividos> ok
[01:03:07] <Telemachos> actually even this isn't totally true because there are more problems in this approach.. some sides will have 2 triangles going up a corner but another side will only have one in that corner
[01:03:16] <Telemachos> (because each side is a quad)
[01:03:30] <Telemachos> so the side with two triangles will be weighted too much
[01:04:47] <Telemachos> Servus - actually I do render most things as triangle lists.. that's good for the vertex cache on the modern cards if they are indexed correctly
[01:06:02] <Telemachos> Vividos: What I would do is this.. for each triangle you parse find out which vertices it uses in the wrml file. Then calculate the correct vertex normal for that triangles s-group
[01:06:05] <Servus> eek
[01:06:32] <Telemachos> then check if another vertex already exists on the exact same location (3d location - use a hash-table for constant-time lookup)
[01:06:50] <Servus> a line of 1000 triangles in tri list 3,000 vertices... same line of 1000 triangles in tri fan = 1002 vertices...
[01:07:05] <Telemachos> if it does you can *only* reuse that vertex if its already stored with the same normal.. otherwise you need a new copy of the 3d-location ... a new vertex
[01:07:35] <Servus> there is a text format called .x that is very easy to parse, and has normals for each vertex
[01:07:55] <Servus> and there are tons of prebuilt parsers for it
[01:08:03] <Telemachos> Yeah, the .x files might do all this in the plugin
[01:08:27] <Servus> just a thought, it's a good format, and it has a compressed binary format
[01:08:55] <Telemachos> Servus - I dont use a triangle list.. I use an *indexed* triangle list of course ;) Each vertex is only there one..
[01:09:47] <Servus> i realize this, even with an optimized vertex cache i have noticed notible performance improvements in triangle fans however, (in direct3d at least! :)
[01:09:53] <Servus> notable*
[01:10:15] <Servus> ok ok well i will see how it is in opengl and stop poking you in the eye for now *shrugs*
[01:10:32] <Telemachos> well, not all geometry is suitable for a tri-fan
[01:10:42] <Telemachos> a strip maybe..
[01:11:09] <Telemachos> btw, you know I use D3D too right ? ;)
[01:11:34] <Servus> if you let the computer decide how to make a fan, it can do quite a bit... there is a stock triangle fan teapot that looks quite normal -- and ive gotten over 1,000 fps in d3d;)
[01:12:36] <Servus> well i'll keep to myself then -- i dont think im gonna convert you to the school of sata-.. i mean triangle fans :-D
[01:14:13] <Telemachos> he heh.. no probably not ;)
[01:15:19] <Servus> well im trying out SDL now so, if i can get away from all my distractions fora while, i might just make something cool:)
[01:16:20] <Telemachos> SDL can be nice.. easy to initialize, cross-platform etc.. buuut, still its openGL which I don't like much ;)
[01:17:03] <vividos> why that?
[01:17:11] <Servus> directx 8 is nice.. .but only compared to directx7 and down :)
[01:17:46] <Telemachos> It might change with openGL 2.0 but for now I think it's too complicated with all the extensions
[01:18:02] <Telemachos> no easy way to just make a vertex shader or pixel shader for example
[01:18:14] <Servus> ive been waiting way too long for opengl2.0:)
[01:18:18] <Telemachos> besides that - religion I guess ;)
[01:19:27] <Telemachos> then there's performance.. I can't make openGL perform as well as DX.. mostly because I cant put the vertices on the card memory like with a static, read-only vertex buffer in DX
[01:20:11] <Telemachos> btw - another s-group example (browing my ooold shots, damn they look ugly.. but the s-group thingie shows well)
[01:20:13] <Telemachos> http://www.peroxide.dk/ultima/screenshot09.htm
[01:20:38] <Telemachos> Here - check the niches on the wall.. again lots of s-groups are used here to make the transitions between light levels sharp
[01:21:08] <Telemachos> Almost hard to believe its just plain vertex lighting huh ? ;)
[01:22:12] <Eldron> ah, yea.. looks like doom3!
[01:22:23] <Servus> not quite:) ive played doom3 =-O
[01:22:43] <Eldron> so have I!.. quite an awesome fps I got..
[01:22:45] <Servus> it took a gig of ram and ran slower than a fat man to a stalk of celery
[01:22:46] <Eldron> notice the "an"
[01:23:09] <Eldron> whats fps in singular?
[01:23:09] <Eldron> :)
[01:23:13] <Servus> i got a little better than that
[01:23:19] <Servus> frame per second -- same thing
[01:23:29] <Eldron> I know, I was kidding.. anyway
[01:23:34] <Eldron> I ran it on a better computer..
[01:23:38] <Eldron> was quite mighty..
[01:23:59] <Eldron> spec and bump maps in realtime is extremely nice
[01:24:03] <Servus> romero says a midline comp with a geforce3 will be able to run it
[01:24:10] <Servus> carmack i mean
[01:26:32] <Telemachos> It needs to be somewhat optimized before that claim holds ;)
[01:28:09] <Telemachos> btw, played with some reflections-stuff today.. works really well I think ;)
[01:28:14] <Telemachos> Check this one out: http://www.peroxide.dk/secret/pond.jpg
[01:28:43] <Telemachos> now if only I could make the reflections "distort" a little more.. hmmm
[01:28:57] <Eldron> distort as in morrowind-style water? :)
[01:29:25] <Telemachos> yeah, but the problem is that they don't *really* reflect the environment so they can "cheat" more easily
[01:29:50] <Telemachos> they seem to just apply some sort of cube-map of the surroundings
[01:30:01] <Eldron> yea, and it updates rarely
[01:30:06] <Eldron> but still looks nice :)
[01:30:37] <Servus> did you play no one lives forever?
[01:30:48] <Servus> water reflections in that game are fantastic, best ive seen in a game
[01:30:53] <Telemachos> yeah tbat part.. I find their water too silvery though.. almost like quick-silver when you look at the horizon
[01:30:58] <Servus> wow thats nice, nice colours :)
[01:31:03] <Servus> err
[01:31:12] <Servus> well not for me - my card doesnt have pixel shaders so it looked perfect
[01:31:12] <Telemachos> don't have that game.. only the first one
[01:31:37] <Servus> what's your performance hit on the water
[01:32:29] <Telemachos> it costs some.. but with a little tweaking it's not that bad..
[01:32:58] <Telemachos> it's EMBM water at the moment so its not even a shader.. then the reflections is mirrored geometry
[01:33:23] <Servus> the morrowind water was a little too liquid-metally, but it had no performance hit :)
[01:33:34] <Telemachos> with special colored fog on it to make it "fade" out.. guess it costs 20% extra or so
[01:34:17] <Telemachos> I wanna implement it in a shader.. then I can apply a fresnel term to it.. I think that'll help
[01:34:33] <Servus> the water is opaque in that pic, yes?
[01:35:05] <Telemachos> not totally but I agree it looks that way.. you have to look quite directly at it to see the transperency
[01:35:43] <Telemachos> and especially now with all the reflections stuff.. but again, thats where the Fresnel term will help ;)
[01:35:44] <Servus> just remember -- in five years, it will look like shit:-)
[01:36:02] <Servus> :P no offense
[01:36:05] <Eldron> heh :)
[01:36:08] <Telemachos> same thing can be said about anything I guess ;)
[01:36:13] <Telemachos> even doom3
[01:36:22] <Servus> ja
[01:36:32] <Servus> im sick of triangles, i wanna draw with molecules:)
[01:36:38] <Eldron> in 5 years we will have 32 player deathmatches in doom3 style enviroments..
[01:37:04] <Servus> graphics actually werent that terrible 5 years ago though.. what was it in 97? duke nukem?
[01:37:37] <Eldron> wasn't that during starcrafts age?
[01:37:53] <Servus> starcraft wasnt cutting edge though :)
[01:37:55] <Telemachos> uuurgh ;) Duke Nukem ;) he heh
[01:37:56] <Servus> and i dunno
[01:38:01] <Eldron> starcraft ran fast :)
[01:38:11] <Servus> twas 2d! that doesnt count
[01:38:12] <vividos> yeah, wrl import sort of works :) now let's plug it into uwadv
[01:38:39] <Servus> the only thing that really suffers from flat-shading is the mattress... turn on global gouraud shading to render the objects and it'll look pretty spiff
[01:39:39] <Eldron> just hope that the player will be bothered saving britania instead of examining beds..
[01:40:52] <vividos> heh :)
[01:41:10] <Servus> what if the bed were shaped and textured like an orc holding an ax?
[01:41:42] <Eldron> the player would cry.. "its all smooth!!"
[01:41:47] <Eldron> "Where are the sharp edges!!"
[01:42:01] <Telemachos> he heh
[01:42:10] <Servus> even smooth axes can perform blunt trauma
[01:42:11] <Telemachos> Thats right! You got it ;)
[01:43:27] <Eldron> oh btw, whenever will the certain tree textures in era get the smooth alpha map it deserves? :)
[01:44:04] <Eldron> just remembered when looking at the screenshot.. "shouldn't those leaves blend nicely with the sky?"
[01:44:22] <Telemachos> which shot? This new one ? ;)
[01:44:27] <Eldron> heh yea..
[01:44:43] <Telemachos> yeah I know, that's a pain in the A$$
[01:44:47] <Eldron> It truly bothered me in second tech demo too >:) some trees were wonderful, then some otheres just went "poof" and cut my eye
[01:45:26] <Telemachos> We apply 1-bit alpha channels to avoid "edges" around the leaves that doesn't blend correctly.. that looks even worse than 1-bit
[01:46:03] <Telemachos> a pretty normal problem it seems.. I've seen many games apply 1-bit at least.. and other that didnt but had those same artefacts.. still there must be some solution ;)
[01:46:07] <Servus> why can't you simply up the alpha bits?
[01:46:46] <Telemachos> to use "true" alpha maps I would have to BSP-sort the leaves.. and the poof - there goes performance ;)
[01:47:06] <Eldron> yea.. each map only uses the sky as background thingie? not the leaves behind?
[01:47:18] <Telemachos> those trees introduce an insane amount of splits for once.. and secondly I would have to draw them ultra-slowly back to front
[01:48:00] <Servus> just wait 5 years for better hardware
[01:48:01] <Servus> :)
[01:48:08] <Eldron> guess I have to turn on AA then
[01:48:20] <Telemachos> they blend with the leaves behind - but only if those are drawn.. the problem is that with mip-mapping enabled there will be edges that are semi-transperant but still fill the z-buffer
[01:48:32] <Telemachos> yeah do that instead - much better ;)
[01:49:08] <Eldron> hehe.. on my gf2 :)
[01:50:29] <Eldron> hmm, win98 just died on me
[01:50:40] <Eldron> hardware acceleration gone.. and my tablet wont work properly..
[01:50:58] <Eldron> yay, turned into 1-bit pressure sensetivity!
[01:51:26] <Telemachos> on/off should be enough ;)
[01:52:05] <Telemachos> like those old guys working the clutch of their car ;) Ever noticed how they tend to use that as an on/off switch ;)
[01:52:23] <Eldron> heh
[01:54:09] <Eldron> well, guess I'll have to finish the texture tomorrow.. school in 4 hours.. must get sleep..
[01:54:13] <Eldron> gnight..
[01:54:35] <vividos> bye Eldron
[01:54:39] <Servus> bye
[01:54:51] --- Eldron is now known as Eld^zz
[01:58:06] <Servus> im out too, tata
[01:58:39] <-- Servus has left IRC ()
[02:06:58] <Telemachos> so how did you end up loading the wrml files then? Just as they appear in the file?
[02:08:58] <vividos> I wrote a simple flex lexer and get out the vertex and texel coordinates "by hand"
[02:09:21] <Telemachos> by hand ?
[02:09:22] <vividos> the format it expects is rather strict, but it should work for all models Servus made
[02:09:53] <Telemachos> but you didn't find that s-group info ?
[02:10:15] <vividos> well, "by hand" is not the exact word. I expect that the actual data follows after some keywords like "coords" or "texCoords"
[02:10:33] <vividos> I don't have a .wrm with s-groups yet
[02:11:19] <Telemachos> hmm.. well if you have the energy you could always ask him to export the stuff to .asc and try that out instead ;) Good practice in lex I guess ;)
[02:11:41] <vividos> heh :)
[02:11:51] <Telemachos> or .ASE althought thats a bit harder
[02:12:20] <vividos> that 3d models stuff is rather complex :)
[02:12:37] <Telemachos> seriously though - Im sure you can write an ASC parser in an hour.. really simple text format
[02:14:11] <vividos> I try out the wrl stuff first - if it looks nicely for most objects, I can do a new release. and maybe after that someone wants to lend a hand here :) I would like to progress the main engine
[02:14:42] <Telemachos> understandable..
[02:15:08] <vividos> I of course like to honor what the 3d people here created
[02:16:20] <Telemachos> wrl is probably fine then.. I mean, I wouldn't even *consider* not using s-group info.. but of course they are only useful to support if the artists actually apply them in max ;)
[02:16:56] <Telemachos> and who knows - maybe the wrl format is actually exported with the correct vertex normals.. and I'm making a fuss about nothing he heh..
[02:17:17] <vividos> there are no normals :)
[02:17:34] <Telemachos> lol..
[02:17:46] <Telemachos> ok, then I guess we DO know for sure ;)
[02:19:00] <Telemachos> then just calculate as if the mesh was in one big s-group.. use the average of the normals of the faces its used in.. better than flat-shading at least
[02:20:42] <Telemachos> btw, feel free at any time to tell me if I try to "preach" too much ;) Just trying to help steer you in the right direction ;) But reading the logs I might have spammed you a bit with info today he heh
[02:23:23] <vividos> you don't "preach" too much. it's quite interesting to hear theory about 3d stuff from a real person, instead of reading tutorials and such
[02:26:33] <Telemachos> ok fine fine ;) Anyway gotta go.. 3.26am here .. I'm getting into a bad habbit of going to bed waaay to late ... cya
[02:26:50] <-- Telemachos has left IRC ()
[02:26:54] <vividos> bye :)
[02:27:25] <vividos> it's 3.26am here, too :) should also go
[02:27:28] <-- vividos has left IRC ("Leaving")
[06:59:05] --> Servus has joined #uwadv
[11:40:45] <-- Servus has left IRC ()
[11:58:08] --> wjp has joined #uwadv
[11:58:08] --- ChanServ gives channel operator status to wjp
[14:59:02] --> yot has joined #uwadv
[17:35:35] <-- yot has left IRC ()
[18:31:06] --> vividos has joined #uwadv
[18:31:06] --- ChanServ gives channel operator status to vividos
[18:35:55] <vividos> hi
[18:37:51] <wjp> hi
[18:39:30] <vividos> I added .wrl model loading today (textures are missing yet)
[18:41:51] <-- vividos has left IRC ("*nngrr* restart")
[18:44:45] --> vividos has joined #uwadv
[18:44:45] --- ChanServ gives channel operator status to vividos
[18:58:15] * vividos thinks about using SDL_image for texture import ...
[18:58:18] <vividos> away a bit
[20:58:18] <-- vividos has left IRC (Read error: 54 (Connection reset by peer))
[22:02:20] <-- wjp has left IRC ("Zzzz...")