160 likes | 264 Views
KIPA Game Engine Seminars. Day 8. Jonathan Blow Ajou University December 4, 2002. Small issues left over from yesterday. Discuss cross-platformness of Keyboard::event Why I converted the 5km map example to centimeters Memory allocation and “block loading”
E N D
KIPA Game Engine Seminars Day 8 Jonathan Blow Ajou University December 4, 2002
Small issues left over from yesterday • Discuss cross-platformness of Keyboard::event • Why I converted the 5km map example to centimeters • Memory allocation and “block loading” • Why block loading is kind of funny
Filter bandwidth • When talking about the frame-time independent filters, I have been speaking of decay rate and not filter bandwidth • When a question was asked in terms of bandwidth, it made me wonder why I do this • Answer: it has to do with uniform vs nonuniform sampling
Event Queues • Show example of a big networking switch like we discussed yesterday • Interesting structure where things can be sent noncentralized, but must be received centralized • An indicator that the structure should be questioned? • Example of in-game object destroy/create, hide/unhide • Another reason to perhaps want that history query feature
Mesh Load/Save • Looking through the code for the triangle strip mesh
Why the Tcp_Connection class • Interface with Web services, etc
Looking at the networkprotocol code… • We talked about UDP vs TCP kinds of things, but never looked at the various classes • Talk about the prevent-a-copy trick for wrapped_send() that I don’t actually do yet • Two-level structure of Net_Manager::* and Network::*
BRDF Rendering • (Show demo again) • Discussion of the basic idea • Two reasons to do this: • Better simulation of the real world • Data-driven shaders
BRDFs:Acquiring the data • Gonioreflectometer measurements • Virtual gonioreflectometer • Raytracer and some microgeometry • Analytic function • Ward model
The Singular Value Decomposition (SVD) • Factor A into VSW* • V and W are unitary • S is diagonal, positive entries on diagonal,highest magnitude first • Same as weighted sum of vectors
Using the SVDon BRDF data • Our starting matrix is 4D, not 2D • Our V, W are 2D matrices • These matrices can be stored as texture maps, and multiplied together • Just 2 texture units per piece of the approximation • The parameterization of V and W are determined by the initial parameterization of A
SVD cost • SVD is very expensive so we can use an approximation instead • Kautz and McCool use the “Normalized Decomposition” (ND)
Dynamic Rangeon conventional hardware? • Need to compute VskW* and store that in the frame buffer • Clamping in texture units causes problems! • s too high? • So we need to scale the s values to therange [0, 1] • Then we suffer a lot of banding in the texture units • This scaling needs to be the same for all objects in the scene • One bright object makes the darker objects suffer
Solved on newer cards • Radeon 9700, Geforce 5 FX • Linear-light frame buffer (gamma = 1), floating point pixels, exponentiate pixels when it’s time to page flip • or let the CLUT / RAMDAC do the right thing • Still not perfect • Limited handling of fp pixels is available (no antialiasing, alpha blending)
Why shaders are not cool • A shader is treated as a monolithic program • Can only call subroutines within that program (no subroutines until pixel shader 2.0) • There can be a combinatoric explosion of shaders based on what you want to do • Example of different BRDF parameterizations