Friday, 2007-06-01

*** render has quit IRC00:04
*** cgTobi sets mode: +vv Pseudonym WayneZacMP00:09
PseudonymG'day.00:09
WayneZacMPg-day00:40
*** cgTobi has quit IRC01:06
*** AlexK has quit IRC01:06
*** WayneZacMP has quit IRC04:10
*** WayneZacMP has joined #aqsis04:47
*** Pseudonym has quit IRC05:01
*** Pseudonym has joined #Aqsis05:23
*** AlexK has joined #aqsis05:36
*** scorp007 has joined #aqsis06:43
*** scorp007 has quit IRC06:55
*** AlexK has quit IRC07:05
*** pgregory has joined #aqsis08:04
*** ChanServ sets mode: +o pgregory08:04
pgregorymorning all08:05
*** AlexK has joined #aqsis08:06
PseudonymG'day.08:06
*** pgregory sets mode: +vv Pseudonym WayneZacMP08:06
pgregoryhi Andrew, how's things?08:06
PseudonymOK.  You?08:06
pgregoryyeah, not bad, not bad at all08:06
pgregorygot the FB back on track08:06
PseudonymCool.08:06
pgregoryneed to think a bit about mutex's and such08:08
pgregorybut it's basically working, and threaded, which is nice.08:08
* Pseudonym nods08:08
PseudonymExcellent.08:08
*** Anteru has joined #aqsis08:13
pgregoryhi Anteru08:22
PseudonymGotta go.  Be back later tonight.08:22
PseudonymNight!08:22
pgregorynight08:23
*** Pseudonym has quit IRC08:23
AnteruMorning Paul08:24
*** AlexK has quit IRC08:24
pgregoryAnteru: no08:24
*** WayneZacMP has quit IRC08:28
AnteruEm?08:30
pgregoryAnteru: you were about to ask if I'd tested OpenEXR 1.4 on windows yet.08:30
AnteruAh, ok - actually I thought it's a kinda late reply at the exception stuff from yesterday ^ :)08:31
AnteruBye, gotta go shopping - catch you later08:42
*** Anteru has quit IRC08:42
*** AlexK has joined #aqsis09:17
*** mafm has joined #aqsis09:58
mafmhi09:58
pgregoryhi mafm, how's things?09:59
mafmnot bad :)10:01
mafmI have several exams during the next week, so I won't be around, I already told to tcolgate10:02
*** render has joined #aqsis10:04
mafmhi render10:09
renderhi10:09
*** pgregory has quit IRC10:27
*** pgregory has joined #aqsis10:28
*** ChanServ sets mode: +o pgregory10:28
*** pgregory sets mode: +vvv render mafm AlexK10:28
pgregoryshame, seems Screen isn't particulalry stable under Cygwin :-(10:28
tcolgatemornin10:32
tcolgatepgregory: I don't think I've ever had any problem with it.10:32
pgregorytcolgate: it just locked up my session10:32
tcolgateAre you using it with the cygwin console or an xterm?10:33
pgregoryI'm ssh'ing in from work10:33
pgregoryI had irssi running in a Screen session, and it just locked up, I killed the ssh connection, reconnected, and tried to run screen -ls and it just sat there.10:34
tcolgateoddyou did do a re-attach when you ran it hte second time yeah?10:37
pgregoryI couldn't re-attach, I couldn't even get "screen -ls" to work10:38
tcolgateewww10:38
*** Anteru has joined #aqsis10:39
AnteruRe10:39
pgregoryhad to login and forcibly kill the screen process10:39
pgregoryI'll give it another go, back shortly, need to restart irssi in a Screen session10:41
AnteruHoi Paul10:41
*** pgregory has left #aqsis10:41
Anteru...10:41
*** pgregory has joined #aqsis10:42
*** ChanServ sets mode: +o pgregory10:42
pgregoryback10:44
Anteruwb pgregory10:44
mafmwb10:45
mafmI spotted a bit of code which isn't apparently doing anything10:45
mafm(when trying to identify parts to be parallelized)10:45
pgregorymafm: where?10:45
mafmit's the content of #if defined(REQUIRED)10:46
mafmat 1368, imagebuffer.cpp10:46
mafmit's apparently counting the number of grids and polygons, but it doesn't do anything with the variables10:47
AnteruThat's maybe a leftover from long time ago when I tried to add some more stats and they turned out to slow down aqsis quite a bit ^10:48
pgregorymafm: the #if defined(REQUIRED) masks that code, don't worry about it. It should be removed if it's not needed, that's what we have SVN for, to avoid unnecessary commenting out of code.10:49
mafmyup10:50
mafmthe thing is that I think that it would be better to remove it from the trunk if possible, and then I would propagate the changes to my branch10:51
pgregoryagreed10:51
mafmin order to parallelize the code core parts will need to be refactored, the more clean that they are before starting, the better :)10:52
pgregory'tis done10:53
* pgregory is waiting on a Boost build here, takes bloody ages.10:53
Anteru1.34?10:54
tcolgateAre they still using bjam?10:54
AnteruBoost.Build2 even ;)10:54
pgregory"a distributed compile farm, a distributed compile farm, my kingdom for a distributed compile farm"10:54
AnteruBoost 1.34 x64 took surely one hour here ...10:54
pgregoryyes, and yes.10:54
pgregoryAnteru: i386 is taking 1-2 hours here10:54
mafmbtw, this multithreading project is quite tricky, I (a newcomer) have to mess with the very core of the software :S10:54
AnteruHmm ...10:54
tcolgatemafm: never said it was going to be easy :)10:55
pgregoryand I'm having to do it as an RPM, so I'm learning RPM stuff at the same time, which means each time I screw up the .spec file, I have to rebuild :(10:55
Anteru.o010:55
pgregorymafm: rest assured, there will be plenty of help along the way, don't be shy, shout when you have trouble.10:55
mafm:D10:55
pgregorythe people in this room know the code intimately.10:56
Anteru^^ Most of them do at least ;)10:56
mafmI'll need it for sure, thanks10:56
tcolgatepgregory: Are there no RPMs of the latest boost?10:58
pgregorynot for RHEL410:58
mafmbut I was wondering yesterday who'll be changing the most parts of the code: maybe it's other people who has to refactor things instead of me (?)10:58
pgregorymafm: as you say, it's a very broad project, I'm certain there will be changes that are best left to us.10:59
pgregoryThe same applies to Zac (the other SoC student), his code is going to rely on work from other team members.10:59
pgregoryfor your project in particular, we need first to decide exactly what you're going to be doing, then we can move on with a plan of action.11:00
Anterupgregory: Are there any docs/ideas about exception handling in Aqsis? I just found http://wiki.aqsis.org/dev/code_review?s=exception but the page does not exist yet.11:01
pgregorynot really, we haven't really considered exception handling in Aqsis up to now.11:01
AnteruIf you don't mind I'll think about it a bit ... basically, I'd like to bring in a system similar to .NET/Java and modify the RiAPI generator so no exceptions propagate out of Ri calls.11:02
mafmbtw I'm preparing a kind of Requirements Document in the wiki: http://wiki.aqsis.org/dev/soc_multithreading11:03
pgregoryAnteru: by all means think about it, discuss it, and above all, document it on the Wiki.11:04
mafmI'm trying to specify now the parts to be made parallel11:04
pgregorymafm: good, you should notify us via the mailing list when you make major changes to that page. Then we can review the progress.11:04
AnteruOk. I just saw it that there was obviously some work in that direction (matrix inverse did report an error if determinant was 0) but it got commented out, so I thought maybe it's time to raise the dead and take a look at it.11:05
AnteruMoreover, it's a software engineering task and I'm quite comfortable with those :)11:05
mafmops, I'm not subscribed to the mailing list r:)11:06
pgregorysounds good11:06
pgregorymafm: probably a good idea to subsribe.11:06
tcolgateThe only use of exceptions I can remember in aqsis is buried in the input reading routine of the RIB parser, it's an ugly little bit of code but getting rid of it proved to be non-trbial.11:06
tcolgatetrvial11:06
pgregoryIt's not particularly busy at the moment, but I hope the SoC will change that.11:06
pgregoryit == the ml11:06
Anterutcolgate: I'd like to have something in place which gives us enough knowledge about the error to treat it right, i.e. whether some invariant was violated (Math error), whether it is system related (I/O, memory) or whether something went really wrong (dice failed or something like that)11:07
*** Joron has joined #Aqsis11:08
tcolgateThe problem with the other bit of code is it's not throwing exception for errors really, it's throwing them as part of normal operation (effectively using them to do a long jump).11:08
* pgregory was just looking at the Boost.Wave thing, looks like an ideal candidate to drop the unmaintainable slpp.11:09
Anterupgregory: Remember when I suggested it ;)11:09
Anterutcolgate: Uah?!? You're joking, right?11:09
mafmsubscribed!11:09
mafmhi Joron11:09
AnteruWell done, mafm11:09
JoronHello all11:09
pgregoryAnteru: yes, and I dismissed it because what we have worked fine. Since then we've discovered a problem with slpp.11:09
tcolgateWe've talked about wave before, the first web page seems clear enough, everything after that seemed to fade into total jibbreish for me.11:10
AnteruAll right ... so what's the deal with Boost.Wave, cause this is something I'm interested in?11:10
Joronwhat was the problem with slpp ?11:10
AnteruDid you discuss it on IRC or somewhere else?11:10
pgregorywe have to write out a temporary file, and the way we handle that at the moment is to use mktemp, which is known to have a race condition risk.11:11
tcolgateIt'd be nice to get something that does gcc style #line XXX filename.cpp  stuff again, and that does nested includes properly.11:11
pgregorywe can't use mkstemp, as we need a filename to pass into slpp, not a handle.11:11
AnteruYeah, I remember I mentioned Boost.Wave exactly because of that problem.11:11
pgregorymodifying slpp to change the way it works is a 'mare.11:12
* tcolgate nods11:12
pgregoryso perhaps now is a good time to consider an alternative.11:12
pgregoryAnteru: pick one thing and stick with it.11:12
pgregoryexception handling is a good thing to do11:12
AnteruYeah, I think the exceptions are better now as I don't know how much time I'll be able to spend.11:13
tcolgateah yes, now I recall why my brain didn't fit well with wave.....11:13
AnteruStarting with Boost.Wave and slowing down half-way doesn't help anyone.11:13
tcolgateit's the bit about the C++ lexer.11:13
tcolgateIt seemed that it is tied (very very tightly) to be a CPP processor for C++11:13
Anteru"Both of the included lexers and the library itself are able to act in a C99 compliant mode"11:14
tcolgateyes, but what will they do if they seem something that isn't C99 either.11:15
AnteruIs SL really that far away from C99?11:16
tcolgateWell it's certainly not C.11:17
AnteruWell, now the users get the full power of variadic macros at hand :)11:17
pgregorygiven the Quick Start stuff in the docs, I'm sure it would be easy to put together a quick test and run it over our shaders to see how it behaves.11:17
AnteruYeah, and it doesn't look to scary to me. Just beware of the compile time issues ^11:18
pgregorywhat compile time issues?11:18
AnteruSeparation and inclusion compilation models under http://boost.org/libs/wave/doc/compiletime_config.html11:18
AnteruCatch you later, gotta "go" to work11:20
pgregorycya11:20
tcolgatehttp://www.codeproject.com/cpp/wave_preprocessor.asp?df=100&forumid=14979&select=1116700#xx1116700xx11:20
tcolgateWhich makes sense.11:21
Joroncya11:21
pgregoryyes, "C-Like" is ambiguous.11:21
tcolgateSo really we "should" implement an SL lexer, or reuse the one we have, or just cave and move down the entire boost route (which I doubt anyone wants to jump into right now).11:22
pgregorythere is a sample supplied that creates a new lexer for the IDL language.11:24
tcolgateah, nice11:26
tcolgateThat page does seem rather old11:26
pgregoryI still think the first thing to try is to see how the cpplexer deals with SL.11:26
pgregoryit at all11:26
tcolgateyeah, it is possible that the terminology on that page is a bit confused and that they mean the pre-processor portions of C99 and C++ rather than the entire language. In which case the C++/C99 code should deal with the pre-processor stuff in SL just fine.11:28
*** Anteru has quit IRC11:31
mafmhmmm11:32
pgregorygahhh11:32
mafmin RenderSurfaces there are several calls to RenderMPGs with the same x* and y* parameters, is that normal?11:32
tcolgateavast!11:32
pgregoryI hate RPM!11:33
pgregorymafm: hold on...11:33
tcolgatemafm: any particular cases that have you worried?11:33
tcolgatepgregory: hating a packaging system really doesn't make much sense.11:34
mafmthere's an initial call that it's always executed, and then it's called in another two places without changing the parameters (unless the method depends on external global variables ?)11:34
pgregorymafm: yes, that's right. Because during the process of RenderSurfaces, any number of primitives may end up getting diced. We want to 'empty' the waiting MP bucket as soon as possible, because they take a large amount of memory, so we call RenderMPGs at various points in the loop to empty an MP's that may have been inserted in the previous step.11:35
tcolgatepgregory: hate Jeff Johnson if yo ulike, he's maintained it for years, a lot of people seem to hate him.11:35
pgregorytcolgate: the problem is, each time it doesn't work, I have to wait another 2 hours. Why can't it build, and retain the build, so I can just to an incremental thing.11:35
pgregoryInstead it cleans everything, unarhives the source and rebuilds the binaries each bleeding time!11:36
mafmah all right11:36
mafmthanks11:36
*** Pseudonym has joined #Aqsis11:36
pgregorymafm: does that make sense.11:37
tcolgatepgregory: I'm sure you appreciate why it does it that way, even if it's not exactly a great experience.11:37
pgregoryHi Pseudonym11:37
tcolgatePseudonym: hey11:37
*** pgregory sets mode: +vv Joron Pseudonym11:37
PseudonymG'day.,11:37
pgregorytcolgate: sure, but I'd like to shortcut it while I'm developing the .spec file.11:37
pgregorylife's too bloody short for 2 hour cycles.11:38
mafmwell, from the parallel thingy point of view, I think that we'll have to work a lot :D11:38
tcolgatemafm:That shouldn't case any problems, the thread is processing the bucket so it can use exactly the same logic.11:39
mafmin example, there are calls to CurrentBucket all over the place, but you can't rely on that when you have several instances running at the same time11:39
mafmyep, but you can't have calls to global variables that can change -- or rather you can, but have to lock the access to them11:41
pgregorymafm: I imagine that code being wrapped up in a class that encapsulates all the "CurrentBucket" status, and implements operator() so can be used in a Boost.Thread.11:41
tcolgatemafm: I'm not sure I follow, your tread  is processing one bucket, so current bucket, for that thread, should return the bucket being procesed.11:41
PseudonymProbably should have been done like that in the first place, in retrospect.11:42
tcolgateCurrentBucket will clearly need to be refactored, for the threaded version it can't be a global returning the same value every time.11:42
mafmyes, but not only CurrentBucket but all the global variables (or functions having side effects) as well11:43
tcolgatecorrect.11:44
pgregorymafm: yes, all that status will have to be wrapped up into the thread class.11:44
pgregorymafm: the first task there is to identify all the global status information that needs to be encapsulated.11:44
tcolgateBut then I don't think anyone was expecting this to be a case of just sprinkling a couple of boost thread calls around, we need proper encapsulation of the environment needed for each bit we are going to thread.11:44
mafmmaybe we could try to set the buckets autonomous, processing their own data and not relying on external functionality11:46
mafmwould that be possible?11:46
tcolgateThere are some external resources they will have to rely on, but we'll have to marshall access to those resources.11:46
pgregorymafm: that pretty much describes the process.11:47
tcolgateLike the texture cache. for instance, but that shouldn't actually have too many issues.11:47
Joronbyebye11:49
*** Joron has quit IRC11:49
PseudonymThose resources can be monitors to begin with.11:49
PseudonymAlthough the texture cache is logically read-only, so that's not a good long-term solution.11:50
PseudonymOne useful trick, by the way, is that hash tables can easily support quite fine-grained locking.11:50
PseudonymBecause hash lines can be locked individually.11:51
PseudonymTrees, for example, are much harder to do.,11:51
mafmwell, if it's read-only then there are no problems11:53
PseudonymNo, it's _logically_ read-only.11:53
PseudonymIn practice, it's a cache.11:54
PseudonymSo elements are going to enter and leave.11:54
mafmoh, right11:55
tcolgateI know there is some work being done on the texture cache at the moment, but you should probably ignore that for now.11:56
PseudonymYeah.  WHo's doing that?  Zac?11:56
tcolgatepgregory: Before I forget, how often does our matrix inversion code get hit do you think? Anteru and I swapped a few ideas on possible ways to speed it up, not sure if it'd be worth it though.11:57
tcolgateatleast at ht emoment.11:57
pgregorythe matrix inversion code is used a lot IIRC11:57
tcolgatePseudonym: Nope, Chris I think11:58
PseudonymWhat did you come up with?11:58
PseudonymRight.11:58
tcolgatetwo things....11:58
pgregorytcolgate: it is also the cause of a bug at the moment, but I don't know the right solution.11:58
tcolgateI read something that said that for the case of pure rotation or translation matrices there are fast methods for doing inversion, so we could possibly test for those cases.11:58
pgregorythe problem is, it's impossible to invert a matrix that has a projection.11:58
pgregoryPseudonym: tcolgate is right, Chris is doing the texture refactor, Zac is doing DSM.11:59
PseudonymRight.11:59
tcolgateSeconds, I thought we could cache the result and set up a pointer to the inversion of a matrix if we have already created it (and have that inversoin contain a back reference to the matrix it was an inversion of in the same way.11:59
PseudonymGotcha.11:59
Pseudonymtcolgate: I tried the second once, and it's tricky.11:59
PseudonymBecause if you invert the inversion...11:59
PseudonymIt also makes the structure more heavy-weight, since it has a pointer in it.11:59
PseudonymBut the first idea is very doable.12:00
PseudonymThe trick is that you keep track of the history of the matrix in a small bitvector.12:00
Pseudonym(Less than 8 bits, IIRC.)12:00
tcolgateyes, I'm showing my naivetie here, but I assumed that the inverse of the inversion would be the original.12:00
PseudonymThe bitvector represents the subgroups that the matrix belongs to.12:01
PseudonymPaul: BTW, inverting a projection matrix is just inverting the 4x4 matrix.12:01
PseudonymSemantically, that's the right thing to do.12:01
PseudonymIt doesn't make a lot of sense, but that's wha tyou do,.12:01
pgregoryPseudonym: well, it doesn't work for us, we get #NaN's12:01
PseudonymWhat should it return?12:02
PseudonymOr should it throw?12:02
pgregoryPseudonym: it probably shouldn't return anything, but the problem is, we need it.12:02
tcolgateWell I suppose NaN is as good a thing as any for it to return.12:03
mafmhmmm, is there any reason for the CqBucket having so many static stuff?12:03
Pseudonymmafm: Apart from statistics, no.12:04
PseudonymHysterical raisins.12:04
pgregoryThis is the bug...12:04
mafmI mean this:12:05
pgregoryhttp://sourceforge.net/tracker/index.php?func=detail&aid=1696939&group_id=25264&atid=38397012:05
mafm        private:12:05
mafm                static  TqInt   m_XOrigin;              ///< Origin in discrete coordinates of this bucket.12:05
mafm                static  TqInt   m_YOrigin;              ///< Origin in discrete coordinates of this bucket.12:05
pgregorythe problem is, for all transformations, we go 'through' "world", but we can't go through "world" from "NDC", or "screen"12:05
pgregorymafm: the reason that is all static is that there currently is only ever one bucket being processed.12:06
PseudonymAh.12:06
mafmok12:06
pgregorymafm: the 'non-static' stuff is the stuff that needs to be around for each bucket, i.e. the primitives/MP lists, that can be populated before we reach the bucket for processing.12:06
tcolgate>>>>> (11:52:32 AM) Pseudonym: Hysterical raisins.12:06
PseudonymPaul: That suggests that it's not the inversion code that's the problem, it's going through "world".12:06
tcolgate#I look away for five seconds and it al mental in here!12:07
Pseudonym:-)12:07
pgregoryPseudonym: yes, but that's pretty deeply ingrained in our code.12:07
Pseudonymtcolgate: google it12:07
pgregorymafm: does that make sense?12:07
pgregorymafm: basically, all the stuff that can 'exist' for any bucket is non-static, the stuff that we only care about for the currently being processes bucket is static, and changes to match the currently processed bucket.12:08
pgregorymafm: it just avoids having tonnes of useless information around in the bucket array.12:08
tcolgatePseudonym: nice, haven't heard that one before.12:10
pgregorymafm: bear in mind an HD image at a bucket size of 16x16 would need 8100 buckets.12:10
Pseudonymtcolgate: When I was an undergrad, I read the jargon file a lot.12:10
mafmso probably all that code would have to be made non-static, but that brings us to a very high memory footprint...12:10
PseudonymHang on, BRB.  Need to take kiddies to bed.12:11
pgregorymafm: not necessarily12:12
mafmdo the buckets really need to be instantiated during all the process? they can be created on the fly if they're independent from each other12:12
pgregorymafm: you could keep the current system for managing the bucket contents, then each time you allocate a bucket to a thread, you introduce a new class that has all the other data, and references the bucket from the array.12:13
PseudonymSo a "bucket" could actually belong to a worker thread.12:13
pgregorymafm: all buckets need to be around from the start, as it's entirely possible that a primitive could be placed into the last bucket in the image from the off.12:14
tcolgateWe need a scheduler for allocating buckets to threads.12:14
pgregorylarge primitives can easily sit in many buckets, waiting to be processed.12:14
tcolgateIt is also possible that processing of one bucket in another thread could add content to the bucket you are currenly processing in a different thread.12:14
PseudonymYeah, I've been thinking about that one a bit.12:15
PseudonymHow does a bucket know when it's actually finished?12:15
pgregoryPseudonym: when the bucket processing list passes it.12:15
* Pseudonym nods12:15
PseudonymAh, good point12:16
pgregorynothing can be placed in 'previous' buckets.12:16
PseudonymI thought of another option, but I don't know if it's a good idea or not.12:16
PseudonymWHen you add a piece of geometry, you increment a reference count in all buckets that it might touch.12:16
PseudonymWhen you split a bucket, you increment the count for the child geometry and then decrement for the parent geometry.  (The order is important!)12:17
PseudonymThe bucket is done when the counter reaches zero.12:17
* mafm reading12:17
tcolgatehmmmm....12:18
tcolgatebucket ordering...12:18
PseudonymI'm not certain if it's a good idea because the counters could easily become a bottleneck.12:18
* mafm getting a headache :S :)12:18
tcolgateWe've done a bit of thinking before out allowing different ordering for buckte processing, clearly that's an issue here, unless Andres suggestion can work.12:19
tcolgatemafm: You've not even met the shader vm yet :)12:19
PseudonymWell, you still need to process the buckets more or less in order.12:19
PseudonymBecause large surfaces will still start off life in the top left-most bucket.12:19
mafmI'm not sure I want to met him :P12:20
tcolgateFirst off, is bucket order an issue, do any of the other renderers allow for different bucket ordering?12:20
PseudonymI don't think so.12:20
PseudonymIt's simply not a useful control.12:20
PseudonymIf you care, render it piecemeal.12:21
tcolgateIf not then we can just make an executive decision on it, Paul, do we care about allowing different bucket processing orders?12:21
pgregorytcolgate: different bucket ordering can be useful, and yes, other renderers do support some bucket ordering choice.12:22
mafmI'm going to lunch now, be back in a while12:22
PseudonymSuch as?12:22
pgregorythe classic example...12:22
tcolgateAt one point I did try and come up with a process that was intended to maximise localtisation of rendering to improve texture cache coherencey, but I could never quite get it right in my head.12:22
pgregoryyou have a LotR style battle sequence, with an army or 100,000 orcs. The camera is looking out over the hoards. the render starts fine, then as soon as it hits the first line, it barfs as it has to load the entire battallion.12:23
pgregoryif you render in columns, you can get better performance out of your caching in that situation.12:23
PseudonymI would have thought that DelayedReadArchive would pretty much fix it, too.12:24
PseudonymSo who supports that?12:24
pgregoryPseudonym: no, as the DRA will have to load for the entire row.12:24
PseudonymAh, OK.12:24
PseudonymAnd apart from row vs column, does anyone support any other orderings?12:25
PseudonymIf those are the only two possibilities, that should be doable.12:25
pgregoryI know WETA rendered the LotR battle stuff on it's side and rotated it in post for that very reason.12:26
pgregoryPseudonym: 3Delight supports "horizontal", "zigzag", "vertical", "spiral", "circle" and "random". With a caveat on "random" ["Should not be used since it is not memory efficient"]12:28
PseudonymYow.12:28
PseudonymSome of those sound more useful than others.12:28
pgregory*cough* gimmick! *cough*12:28
PseudonymYeah.12:28
PseudonymHorizontal and vertical make the msot sense.12:29
PseudonymZigzag... well, if you're producing jpegs directly, I guess.12:29
PseudonymGrowing outwards from a point of interest I can see.12:29
pgregoryI think other renderers support things like spiral to make processing of GI data more efficient, and to allow easier preview, you can tell a lot sooner that your render is rubbish if yo usee it from the middle out.12:30
* Pseudonym nods12:30
pgregoryI guess the only way we can be sure is to come up with a set of 'rules' for each method, that basically encapsulate the following query...12:31
pgregory"given the current list of completed buckets, can <this> bucket accept any more data?"12:31
PseudonymHmm.12:31
PseudonymIf we're looking at 10,000 or so buckets, then precomputing the bucket order and just scanning through it is feasable.12:32
pgregory?12:32
PseudonymOK, think about this for a moment.12:32
PseudonymSuppose we use my idea of putting a counter in each bucket.12:32
PseudonymSo for each surface that we add, we're sold on the fact that we're going to scan every bucket that it touches.12:33
PseudonymWith me?12:33
pgregoryyep12:33
PseudonymOK.12:33
PseudonymBefore we start reading in geometry, we effectively sort the buckets by the order that they're going to be visited in.12:34
PseudonymAnd we represent this with an integer in each bucket.12:34
PseudonymNow.12:35
PseudonymWhen we add a piece of geometry to the scene, we add it to the bucket with the smallest "number" that isn't already finished.12:35
PseudonymSince we scan all of the buckets that it touches, we can find out which one it is as we go.12:35
pgregoryright, that basically mimics what we currently do, but more flexibly.12:36
PseudonymThen when we've finished scanning, pop it in that bucket.12:36
PseudonymRight.12:36
PseudonymAnd with minimal overhead.12:36
pgregoryhow does that help us determine if a bucket is 'really' finished when it is empty?12:36
PseudonymAh.12:36
PseudonymOK.12:36
PseudonymWhen we add a piece of geometry, we first scan all of the buckets that it touches.12:37
PseudonymAs we do that, we increment a reference count in the bucket.12:37
pgregoryright, with you12:37
PseudonymA nonzero reference count means "there's still some more geometry to go in here".12:37
pgregory"there *might* still be some more geometry to go in here"12:38
pgregoryas the bound is aligned12:38
PseudonymWhen we split a surface, we increment the reference counts for the buckets that the children touch, THEN decrement the reference counts for the parent.12:38
PseudonymThe order is important.12:38
pgregorythat would mean a bucket needs references to it's geometry, *and* the geometry needs references to it's bucket(s).12:39
PseudonymNo!12:39
PseudonymThe geometry only needs to know its bounding box in bucket coordinates.12:39
pgregoryhow do we decrement the count then? we scan again? isn't that a bit costly12:39
PseudonymIt might be.12:40
pgregorygiven how many times we split geometry.12:40
PseudonymTrue, but remember that we're going to spend very little time manipulating reference counts compared to, say, evaluating shaders.12:40
PseudonymYou're right, it might cost.12:41
pgregoryyeah, and it could be optimised later if it showed up as a bottleneck.12:41
* Pseudonym nods12:41
PseudonymTHere are techniques for optimising this.12:41
pgregorysure12:41
pgregorythat sounds like a very workable solution, and will afford us the flexibility to choose completely arbitrary rendering orders.12:42
PseudonymOne thing that springs to mind, for example, is that you don't need the reference count for a bucket until the moment that you want to start processing it.12:42
* pgregory notes we have another great idea on the table, the table is getting quite full.12:42
pgregorywe need some people around the table grabbing the ideas ;-)12:43
Pseudonym:-)12:43
PseudonymI'm looking at the CoordSysTransform problem at the moment.12:44
pgregoryexcellent, that would be a good one to clean up.12:44
PseudonymMaybe everywhere that we store world space, we should store screen space right next to it.12:44
pgregoryI'd like to get the new FB to a 'workable' stage soon, then merge that in for others to play with.12:44
pgregorythen I will be free to take on some other task.12:45
* Pseudonym nods12:45
PseudonymOh, back to the matrix inversion thing.12:45
PseudonymThe idea, and it's from one of the Graphics Gems books, is to keep track of what subgroups a transformation belongs to.12:45
pgregoryyeah, we used to do that at Superscape, showed massive wins for us.12:46
PseudonymSo, for example, a rotation is distance and angle preserving, and it's orthonormal.12:46
PseudonymYeah.12:46
pgregoryyou can tailor things like matrix multiplies using that information too.12:46
PseudonymAnd when you multiply two matrices, you just "and" the bit vectors.12:46
PseudonymThat'd be a fun task for a beginner, I think.12:46
* pgregory thinks there are as many definitions of the word "fun" as there are people in this chatroom. :)12:47
PseudonymAt the moment, we keep track of whether or not a matrix is an identity.12:47
Pseudonym"Fun" in this sense means "easy to do, not requiring a lot of experience with the code base, and likely to show benefits quickly".12:47
pgregoryagreed12:48
pgregorywe should add that to the list of tasks on the Wiki12:48
tcolgatesorry, stuck in the real world for a bit12:48
pgregorytcolgate: I think it'll take a while to catch up, I've never seen this forum so active.12:49
tcolgateGod damn police forces12:50
pgregory?12:50
PseudonymSounds serious.12:50
pgregoryprobably just means the UK police force can't send emails at the moment :-)12:50
*** scorp007 has joined #aqsis12:51
pgregoryhi scorp00712:51
*** pgregory sets mode: +v scorp00712:51
scorp007hi all12:52
pgregoryPseudonym: would you mind detailing your "out of order bucket processing" proposal on the Wiki?12:52
tcolgateooh blimey, all very productive12:52
tcolgateOk, so re: bucket ordering.12:52
PseudonymErm... OK.12:52
pgregorycheerws12:52
tcolgateOur bucket scheduler I suppose effectively becomes the things that gives the ordering, and for any given scheduler we could just have a method that determines the completion of buckets too.12:53
tcolgateI need to re-read Andrews stuff to get my heard round it though, as perhaps that's a more generic solution.12:54
PseudonymThere might be, yes.12:54
pgregorytcolgate: it's totally generic12:54
tcolgatere: matrix math, I've got the GG series lying around at home, perhaps I should have a trawl through them.12:54
pgregoryalthough, as with 3Delight, certain bucket orders will be more efficient than others.12:54
Pseudonymtcolgate: Yes!12:54
PseudonymPlease do.12:54
PseudonymI think that "random" makes no sense.12:55
PseudonymSomething more like "Peano" might.12:55
* Pseudonym rebuilds... just touched renderer.h...12:55
* Pseudonym waits forever...12:55
tcolgateI was trying to figure out a strategy that would basically result in an ordering similar to the one used in jpeg compression12:55
Pseudonymtcolgate: See above, re "zigzag".12:56
* pgregory notes, that's another thing we need to review, header inclusions.12:56
tcolgateI didn't want to be too literal on the zig zag thing though, I basically wanted to follow where the geometry we had created had gone to where possible.12:57
pgregory"peano", "hilbert", the list is endless12:57
tcolgatepeano sounds like Pinot.... mmmmmmm...... wine.12:57
PseudonymI guess you kind of want something pseudo-random.12:58
PseudonymBut surely "large prime" would do.12:58
tcolgateThe idea was that if, when we are splitting and dicing, we push loads of geometry into the ucket below us, then we move on to that one next.12:59
tcolgatethen we'd move back up and right later.12:59
pgregoryhmm, that wouldn't fit into the proposal.12:59
pgregorythe proposal relies (unless I'm mistaken) on an identifiable ordering up front.13:00
tcolgateTHe idea is to keep rendering in busy areas for as long as we can on the assumption that you'd have some locality of texture access.13:01
PseudonymPaul, just checking one thing.13:01
tcolgatepgregory: header inclusion really should be part of the code review.13:01
PseudonymIs it just the geometry projection that's a problem with this NDC space thing, or are there problems with the shader too?13:02
scorp007whoa, I have't read all the logs, but I'd just like to add that in addition to the bucket orders listed already, some programs provide interactive bucket ordering as a temporary override to the default. So if a user really wants to see a part of an image rendered first, that area will be given priority, then the rendering will continue as normal.13:02
scorp007Mantra and Vray implement this13:02
scorp007but that's just bells and whistles, I guess13:03
pgregoryit's anything that wants to use the CqRenderer matSpaceToSpace call where the "from" is "NDC" or 'later'.13:03
pgregoryscorp007: yes, as long as the order is defineable up front, it should be possible to support it.13:03
scorp007when you say up front, do you mean at the beginning of the rendeR?13:04
pgregoryscorp007: yes13:04
scorp007mantra and vray do it at runtime, via events to the framebuffer13:04
tcolgatescorp007: For a ray tracer that is easy enough to do, harder in REYEs though.13:05
pgregoryscorp007: we can't easily support that.13:05
scorp007tcolgate: I guess that's true13:05
scorp007pgregory: sure, it's not something I consider vital13:05
scorp007just thought I'd mention it13:05
tcolgateAlso, as long as we stick to the standard display driver interface, you can't really give that kind of user feedback to the renderer.13:05
scorp007well, exhibit provides a two-way communication, doesn't it?13:06
tcolgateWe could possibly support something along those lines for re-rendering if we let eqshibit launch aqsis with some crop window value I suppose.13:06
scorp007so you can perhaps pause/cancel the render via the framebuffer?13:06
scorp007that would indeed be useful13:06
pgregoryscorp007: not currently, it's all one way.13:07
scorp007