Path: chuka.playstation.co.uk!news From: Tom Newsgroups: scee.yaroze.mydemos Subject: Re: Environment mapping Date: Wed, 03 Feb 1999 09:54:43 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 56 Message-ID: <36B81CE3.BC8@bristol.ac.uk> References: <36B254E3.6637@mdx.ac.uk> <36B5894C.4CA9@bristol.ac.uk> <36B741A2.463C@mdx.ac.uk> NNTP-Posting-Host: n72.fen.bris.ac.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (WinNT; I) Harvey Cotton wrote: > Thanks for this! I've spent the past few days scratching my head on this > one. I had a few ideas myself, but nothing practical to work with. > I will check out your demo after I finish this reply. > > > PS It also demonstrates motion blurring, I'd be impressed if you put > > that in without slowing down the game too much. It takes an extra > > 100-odd hSyncs on my demo but it makes the frame rate hard to read > > 'cause it's all blurred. Doh! > > Is that a challenge? :) I'll see if I can get the thing working first, > but I reckon I can probably fit something in without slowing the > game down. My game has over 100 hsyncs spare to mess with, before the > dang thing starts slowing down. It seems to me that if you manage to squeeze all these effects into the game you'll be able to match the graphical splendor of RR4 (and won't that be somthing). Craig Graham wrote: > You've already got the surface normals pre-calculated in the TMD file > (if you're using the right primitive types). Problem solved..... > Just apply the local to world matrix to each normal in the TMD using > ApplyMatrixSV() (or something), cache the results and use them to process > each poly of the TMD cache them because each rotated vertex normal will >probably be used by several poly's and it saves doing the local to world > transform several times.... > If the local to world involves scaling, you might want to have a seperate > non-scaling matrix to use for rotating instead to maintain the unified > vector length on the normal. The model that I used was pre-calculated (I only figured out how to do it so I'm doing rather too much dynamic TMD creation for my own good at the moment), so I had trouble working out what the surface normals should be. If the model you are trying to map is only made out of triangles, you can create an array of MATRIX structures and put the normal values for each of the three verticies of the polys in a matrix. Then, you can just rotate the matrix using RotMatrix0() and Bob's your uncle you've got the new surface normals. This method does recalculate some normal values, but what the hell, it is quite nice. Cheers, Tom