![]() ![]() ![]() ![]() ![]() |
![]() ![]() ![]() ![]() |
![]() ![]() |
![]() |
( 11 of 30 ) |
United States Patent | 6,639,595 |
Drebin , et al. | October 28, 2003 |
A graphics system including a custom graphics and audio processor produces exciting 2D and 3D graphics and surround sound. The system includes a graphics and audio processor including a 3D graphics pipeline and an audio digital signal processor. Cartoon lighting and other non-photorealistic effects can be produced by using a lighting calculation to produce a parameter other than color or opacity for use in a later modification of a color or opacity value. In more detail, the example embodiment uses the lighting calculation to generate texture coordinates used in a texture mapping operation. The texture mapping operation allows lighting computation results to select between brush strokes for cartoon lighting and other effects. The resulting dynamic cartoon lighting animation can be performed on a low cost platform such as a home video game system or personal computer.
Inventors: | Drebin; Robert A. (Palo Alto, CA); Yasumoto; Yoshitaka (Osaka, JP); Hollis; Martin (Cambridge, GB); Demers; Eric (Redwood City, CA) |
Assignee: | Nintendo Co., Ltd. (Kyoto, JP) |
Appl. No.: | 726216 |
Filed: | November 28, 2000 |
Current U.S. Class: | 345/426; 345/420; 345/520; 345/582; 345/589 |
Intern'l Class: | G06T 015/60 |
Field of Search: | 345/426,582,419,522,420,589 |
4275413 | Jun., 1981 | Sakamoto et al. | |
4388620 | Jun., 1983 | Sherman. | |
4425559 | Jan., 1984 | Sherman. | |
4570233 | Feb., 1986 | Yan et al. | |
4658247 | Apr., 1987 | Gharachorloo. | |
4725831 | Feb., 1988 | Coleman. | |
4829295 | May., 1989 | Hiroyuki. | |
4862392 | Aug., 1989 | Steiner. | |
4866637 | Sep., 1989 | Gonzalez-Lopez et al. | |
4901064 | Feb., 1990 | Deering. | |
4914729 | Apr., 1990 | Omori et al. | |
4945500 | Jul., 1990 | Deering. | |
5016183 | May., 1991 | Shyong. | |
5097427 | Mar., 1992 | Lathrop et al. | |
5136664 | Aug., 1992 | Bersack et al. | |
5170468 | Dec., 1992 | Shah et al. | |
5361386 | Nov., 1994 | Watkins et al. | |
5392385 | Feb., 1995 | Evangelisti et al. | |
5392393 | Feb., 1995 | Deering. | |
5421028 | May., 1995 | Swanson. | |
5457775 | Oct., 1995 | Johnson, Jr. et al. | |
5467438 | Nov., 1995 | Nishio et al. | |
5473736 | Dec., 1995 | Young. | |
5495563 | Feb., 1996 | Winser | 345/582. |
5504499 | Apr., 1996 | Horie et al. | |
5504917 | Apr., 1996 | Austin. | |
5557712 | Sep., 1996 | Guay. | |
5566285 | Oct., 1996 | Okada. | |
5594854 | Jan., 1997 | Baldwin et al. | |
5606650 | Feb., 1997 | Kelley et al. | |
5608424 | Mar., 1997 | Takahashi et al. | |
5649082 | Jul., 1997 | Burns. | |
5687304 | Nov., 1997 | Kiss | 345/419. |
5687357 | Nov., 1997 | Priem. | |
5701444 | Dec., 1997 | Baldwin. | |
5721947 | Feb., 1998 | Priem et al. | |
5727192 | Mar., 1998 | Baldwin. | |
5740343 | Apr., 1998 | Tarolli et al. | |
5758182 | May., 1998 | Rosenthal et al. | |
5764243 | Jun., 1998 | Baldwin. | |
5768626 | Jun., 1998 | Munson et al. | |
5768629 | Jun., 1998 | Wise et al. | |
5774133 | Jun., 1998 | Neave et al. | |
5777629 | Jul., 1998 | Baldwin. | |
5798770 | Aug., 1998 | Baldwin. | |
5801706 | Sep., 1998 | Fujita et al. | |
5801716 | Sep., 1998 | Silverbrook. | |
5805868 | Sep., 1998 | Murphy. | |
5815166 | Sep., 1998 | Baldwin. | |
5821949 | Oct., 1998 | Deering. | |
5874969 | Feb., 1999 | Storm et al. | |
5917496 | Jun., 1999 | Fujita et al. | |
5920326 | Jul., 1999 | Rentschler et al. | |
5940086 | Aug., 1999 | Rentschler et al. | |
5943058 | Aug., 1999 | Nagy. | |
5949424 | Sep., 1999 | Cabral et al. | |
5949440 | Sep., 1999 | Krech, Jr. et al. | |
5956042 | Sep., 1999 | Tucker et al. | 345/426. |
5969726 | Oct., 1999 | Rentschler et al. | |
5999196 | Dec., 1999 | Storm et al. | |
6002409 | Dec., 1999 | Harkin. | |
6023261 | Feb., 2000 | Ugajin. | |
6023738 | Feb., 2000 | Priem et al. | |
6025853 | Feb., 2000 | Baldwin. | |
6028611 | Feb., 2000 | Anderson et al. | |
6037949 | Mar., 2000 | DeRose et al. | |
6057852 | May., 2000 | Krech, Jr. | |
6092124 | Jul., 2000 | Priem et al. | |
6173367 | Jan., 2001 | Aleksic et al. | |
6181352 | Jan., 2001 | Kirk et al. | |
6198488 | Mar., 2001 | Lindholm et al. | 345/426. |
6226012 | May., 2001 | Priem et al. | |
6232981 | May., 2001 | Gossett | 345/582. |
6239810 | May., 2001 | Van Hook et al. | 345/420. |
6417858 | Jul., 2002 | Bosch et al. | 345/522. |
Foreign Patent Documents | |||
2070934 | Dec., 1993 | CA. | |
1 074 945 | Feb., 2001 | EP. | |
1 075 146 | Feb., 2001 | EP. | |
1 081 649 | Mar., 2001 | EP. | |
11053580 | Feb., 1999 | JP. | |
11076614 | Mar., 1999 | JP. | |
11161819 | Jun., 1999 | JP. | |
11203500 | Jul., 1999 | JP. | |
11226257 | Aug., 1999 | JP. | |
11259671 | Sep., 1999 | JP. | |
11259678 | Sep., 1999 | JP. | |
2000-66985 | Mar., 2000 | JP. | |
2000-92390 | Mar., 2000 | JP. | |
2000-132704 | May., 2000 | JP. | |
2000-132706 | May., 2000 | JP. | |
2000-149053 | May., 2000 | JP. | |
2000-156875 | Jun., 2000 | JP. | |
2000-182077 | Jun., 2000 | JP. | |
2000-207582 | Jul., 2000 | JP. | |
2000-215325 | Aug., 2000 | JP. | |
WO 94/10641 | May., 1994 | WO. |
Photograph of Sony PlayStation II System. Photograph of Sega Dreamcast System. Photographo of Nintendo 64 System. Whitepaper: 3D Graphics Demystified, Nov. 11, 1999, www.nvidia.com. Whitepaper: "Z Buffering, Interpolation and More W-Buffering", Doug Rogers, Jan. 31, 2000, www.nvidia.com. Whitepaper: Using GL_NV_vertex_array and GL_NV_fence, posted Aug. 1, 2000, www.nvidia.com. Whitepaper: Anisotropic Texture Filtering in OpenGL, posted Jul. 17, 2000, www.nvidia.com. Whitepaper: Mapping Texels to Pixels in D3D, posted Apr. 5, 2000, www.nvidia.com. Whitepaper:Guard Band Clipping, posted Jan. 31, 2000, www.nvidia.com. Whitepaper: Cube Environment Mapping, posted Jan. 14, 2000, www.nvidia.com. Whitepaper: Color Key in D3D, posted Jan. 11, 2000, www.nvidia.com. Whitepaper: Vertex Blending Under DX7 for the GeForce 256, Jan. 5, 2000, www.nvidia.com. Whitepaper: Optimizing Direct3D for the GeForce 256, Jan. 3, 2000, www.nvidia.com. Whitepaper: Dot Product Texture Blending, Dec. 3, 1999, www.nvidia.com. Whitepaper: Technical Brief: AGP 4X with Fast Writes, Nov. 10, 1999, www.nvidia.com. Technical Brief: Transform and Lighting, Nov. 10, 1999, www.nvidia.com. Technical Brief: What's New With Microsoft DirectX7, posted Nov. 10, 1999, www.nvidia.com. Mitchell et al., "Multitexturing in DirectX6", Game Developer, Sep. 1998, www.gdmag.com. VisionTek, "GeForce2 GS Graphics Processing Unit", .COPYRGT.2000 www.visiontek.com. Jim Bushnell et al. "Advanced Multitexture Effects With Direct3D and OpenGL", Pyramid Peak Design & ATI Research, Inc., GameDevelopers Conference, .COPYRGT.1999. Sony PlayStation II Instruction Manual, Sony Computer Entertainment Inc., .COPYRGT.2000. Stand and Be Judged, Next Generation, May 2000. PlayStation II: Hardware Heaven or Hell?, Next Generation, Jan. 2000. Chris Charla, "Play Station II: The Latest News", Next Generation, Sep. 1999. "First PlayStation II Gameplay Screens Revealed!", Next Generation, Sep. 1999. Game Enthusiast Online Highlights, Mar. 18, 1999. Game Enthusiast Online Highlights, Mar. 19, 1999. Game Enthusiast Online Highlights, Mar. 17, 1999. Game Enthusiast Online Highlights, Oct. 20, 1999. Joel Easley, "PlayStation II Revealed", Game Week, Sep. 29, 1999. Inside Sony's Next Generation Playstation, .COPYRGT.1999. Press Releases, Mar. 18, 1999. Chris Johnston, "PlayStation Part Deux", Press Start, .COPYRGT.1999. Nikkei Shimbun, "Sony Making SME, Chemical and SPT into Wholly-Owned Subsidiaries", Mar. 9, 1999. AM News: Japanese Developers Not All Sold on PS2, Next Generation, Mar. 16, 1999. Sony To Turn PlayStation Maker Into Wholly Owned Unit-Nikkei, Dow Jones News Service, Mar. 8, 1999. Yumiko Ono, Sony Antes Up Its Chips In Bet On New Game System, Dow Jones News Service, Mar. 4, 1999. MacWeek.Com Gets Inside Story on Connectix VGS for Windows; Controversial Emulator of Sony PlayStation Games Cureently Available for Macs Only, Business Wire, Mar. 12, 1999. "DexDrive Bridges Gap", The Tampa Tribune, Mar. 12, 1999. A Microprocessor With a 128b CPU, 10 Floating-Point MAC's, 4 Floating-Point Dividers, and an MPEG2 Decoder, 1999 IEEE International Solid-State Circuits Conference, Feb. 16, 1999. Dreamcast Instruction Manual, Sega Enterprises, Ltd., .COPYRGT.1998. "Sega To Launch Video Camera for Dreamcast", Reuters Business News, Feb. 16, 2000. David Pescovitz, "Dream On", Wired, Aug. 1999. Randy Nelson, "Dreamcast 101: Everything You Ever Wanted To Know About Sega's Powerful New Console", Official Sega Dreamcast Magazine, Jun. 1999. 2D/3D Graphics Card User Manual, Guillemot .COPYRGT.1999. Nintendo 64 Instruction Booklet, Nintendo of America, 1998. Steven Levy, "Here Comes PlayStation II", Newsweek, Mar. 6, 2000. David Sheff, "Sony Smackage: Test Driving The PlayStation II", Wired, Nov. 1999. Introducing The Next Generation PlayStation, Sony Computer Entertainment Inc., .COPYRGT.1999. Leadtek GTS, Aug. 3, 2000, www.hexus.net. Voodoo 5 5500 Review, Jul. 26, 2000, www.hexus.net. ATI Radeon 64 Mag DDR OEM, Aug. 19, 2000, www.hexus.net. Microsoft Xbox--The Future of Gaming, Microsoft Xbox Performance Sheet, www.xbox.com. Robert L. Cook, "Shade Trees", Computer Graphics, vol. 18, No. 3, Jul. 1984. Wang et al., "Second-Depth Shadow Mapping", Department of Computer Science, Univ. N.C, Chapel Hill, N.C. pp. 1-7. Peercy et al., "Efficient Bump Mapping Hardware", Computer Graphics Proceedings, Annual Conference Series, 1997. Gustavo Oliveira, "Refractive Texture Mappig, Part One", www.gamasutra.com, Nov. 10, 2000. John Schlag, Fast Embossing Effects on Raster Image Data, Graphics Gems IV, Edited by Paul S. Heckbert, Computer Science Department, Carnegie Mellon University, Academic Press, Inc., 1994,pp. 433-437. James F. Blinn, "Simulationof Wrinkled Surfaces," Caltech/JPL, pp. 286-292, SIGGRAPH 78 (1878). Tomas Moller and Eric Haines "Real-Time Rendering", AK Peters, Ltd., .COPYRGT.1999, pp. 127-142. Technical Presentation: Vertex Buffers, posted Jun. 12, 2000, www.nvidia.com. Technical Presentation: Hardware Transform and Lighting, www.nvidia.com, posted Jun. 12, 2000. Technical Presentation: Hardware Bump-mapping Choices and Concepts, Jun. 7, 2000, www.nvidia.com. Technical Presentation: How to Bump Map a Skinned Polygonal Model, Jun. 7, 2000, www.nvidia.com. Technical Presentation: Computations for Hardware Lighting and Shading, Mar. 17, 2000, www.nvidia.com. Technical Presentation: Practical Bump-mapping for Today's GPUs, Mar. 17, 2000 www.nvidia.com. Technical Presentation: Shadows, Transparency, & Fog, Mar. 17, 2000 www.nvidia.com. Technical Presentation: GeForce 256 Register Combiners, Mar. 17, 2000, www.nvidia.com. Technical Presentation: TexGen & The Texture Matrix, Mar. 15, 2000 www.nvidia.com. Technical Presentation: Toon Shading, Mar. 15, 2000, www.nvidia.com. Technical Presentation: D3D 7 Vertex Lighting, Mar. 15, 2000, www.nvidia.com. Technical Presentation: Per-Pixel Lighting (by S. Dietrich) Mar. 14, 2000 www.nvidia.com Technical Presentation: GeForce 256 and RIVA TNT Combiners, Dec. 8, 1999, www.nvidia.com. Technical Presentation: Vertex Cache Optimization, Nov. 12, 1999, www.nvidia.com Technical Presentation: Vertex Blending, Nov. 12, 1999, www.nvidia.com. Technical Presentation: Hardware Transform and Lighting, Nov. 12, 1999, www.nvidia.com. Technical Presentation: GeForce 256 Overview, Nov. 12, 1999, www.nvidia.com. Technical Presentation: DirectX 7 and Texture Management, Nov. 12, 1999 www.nvidia.com. Technical Presentation: Dot Product Lighting, Nov. 12, 1999, www.nvidia.com. Technical Presentation: Texture Coordinate Generation, Nov. 3, 1999, www.nvidia.com. Technical Presentation: Phong Shading and Lightmaps, Nov. 3, 1999, www.nvidia.com. Technical Presentation: The ARB_multitexture Extension, Nov. 3, 1999, www.nvidia.com. Technical Presentation: Multitexture Combiners, Nov. 3, 1999, www.nvidia.com. Technical Presentation: Emboss Bump Mapping, Nov. 3, 1999, www.nvidia.com. Technical Presentation: Hardware Accelerated Anisotropic Lighting, Nov. 3, 1999, www.nvidia.com. Technical Presentation: Guard Band Clipping, Nov. 3, 1999, www.nvidia.com. The RenderMan Interface, Stephan R. Keith, Version 3.1, Pixar Animation Studios, Sep. 1989. The RenderMan Interface, Version 3.2, Pixar Animation Studios, Jul. 2000, www.pixar.com. NVIDIA Product Overview, "GeForce2Ultra", NVIDIA Corporation, Aug. 21, 2000, www.nvidia.com. Duke, "Dreamcast Technical Specs", Sega Dreamcast Review, Sega, Feb. 1999, www.game-revolution.com. Marlin Rowley, "GeForce 1 & 2 GPU Speed Tests", May 11, 2000, www.g256.com. "Dreamcast: The Full Story", Next Generation, Sep. 1998. DirectX 7.0 Programmer's Reference, Microsoft Corporation, 1995-1999 (as part of the DirectX 7.0 SDK on the Companion CD included with "Inside Direct3D", Microsoft Programming Series, Peter J. Kovach, Microsoft Press, 1999). "Inside Direct3D", Microsoft Programming Series, Peter J. Kovach, Microsoft Press, 1999. "OpenGL Programming Guide, The Official Guide to Learning OpenGL, Release 1", Jackie Nieder, Tom David, Mason Woo, Addison-Wesley Publishing Co., 1993. "Procedural Elements for Computer Graphics," Second Edition, David F. Rogers, McGraw-Hill, 1998. "Real-Time Rendering," Tomas Molleir, Eric Haines, AK Peters, 1999. "Computer Graphics, Principles and Practice," Second Edition, The Systems Programming Series, Foley, van Dam, Fiener, Hughes, Addison Wesley, 1990. "Principles of Three-Dimensional Computer Animation", Revised Edition, Michael O'Rourke, W.W. Norton & Company, 1998. White Paper, Dietrich, Sim, "Cartoon Rendering and Advanced Texture Features of the GeForce 256 Texture Matrix, Projective Textures, Cube Maps, Texture Coordinate Generation and DOTPRODUCT3 Texture Blending," (Dec. 16, 1999). |
Color Value Converted texture coordinate Nearest value 0 0 0 64 64.251 64 127 127.498 127 128 128.502 129 192 192.753 193 254 254.996 255 255 256 255
Color Value Converted texture coordinate Coords looked up 0 -0.5 0, 0 1 0.504 0, 1 2 1.508 1, 2 3 2.512 2, 3 4 3.516 3, 4 126 125.994 125, 126 127 126.998 126, 127 128 128.002 128, 129 253 253.492 253, 254 254 254.496 254, 255 255 255.5 255, 255
Register Address Definition Configuration 0/0600 Reserved 0x0601 Reserved 0x0602 Reserved 0x0603 Light0 32b: RGBA (8b/comp) 0x0604 Light0A0 20b: cos atten. A.sub.0 0x0605 Light0A1 20b: cos atten. A.sub.1 0x0606 Light0A2 20b: cos atten. A.sub.2 0x0607 Light0K0 20b: dist atten. K.sub.0 0x0608 Light0K1 20b: dist atten. K.sub.1 0x0609 Light0K2 20b: dist atten. K.sub.2 0x060a Light0Lpx 20b: x light pos, or inf 1dir x 0x060b Light0Lpy 20b: y light pos, or inf 1diry y 0x060c Light0Lpz 20b: z light pos, or inf 1dir z 0x060d Light0Dx/Hx 20b: light dir x, or 1/2 angle x 0x060e Light0Dy/Hy 20b: light dir y, or 1/2 angle y 0x060f Light0Dz/Hz 20b: light dir z, or 1/2 angle z 0x0610-0x067f Light(n)data See Light0 data 0x0680-0x07ff Not used Reserved
If (new attribute = = new light for color X) Accumulate new light into color X Increment number of lights for color X End If (number of lights for color X is maximum) Transfer color to multiplier Perform material multiply End If (color X is in multiply state) Accumulate color X first End If (Accumulation of color X is complete (RGBX or AXX or RGBA)) Format color X for color, if color enabled Format color X for texture, if texture enabled and color disabled or color already loaded Load output fifo with formatted data, increment color/texture count End If (color count and texture count at maximum) Write data to BOP Pop fifo End
Register Address Definition Configuration 0x1000 Error 0x1001 Diagnostics 0x1002 State0 Internal state register0 0x1003 State1 Internal state register1 0x1004 Xf_clock Enables power saving mode 0: No power saving when idle 1: Enable power saving when idle 0x 1005 ClipDisable Disables some or all of clipping B[0]: When set, disables clipping detection (0 default) B[1]: When set, disables trivial rejection (0 default) B[2]: When set, disables cpoly clipping acceleration (0 default) 0x1006 Perf0 Performance monitor selects 0x1007 Perf1 Xform target performance register: [6:0]: Xform internal target performance (Cycles/vertex) 0x1008 InVertexSpec B[1:0]: Specifies host supplied color0 usage: 0: No host supplied color information 1: Host supplied color0 2: Host supplied color0 and color1 B[3:2]: Specifies host supplied normal: 0: No host supplied normal 1: Host supplied normal 2: Host supplied normal and binormals B[7:4]: Specifies # of host supplied texture coordinates 0: No host supplied textures 1: 1 host supplied texture pair (S0, T0) 2-8: 2-8 host supplied texturepairs 9-15: Reserved 0x1009 NumColors Specifies the number of colors to output: 0: No xform colors active 1: Xform supplies 1 color (host supplied or computed) 2: Xform supplies 2 colors (host supplied or computed) 0x100a Ambient0 32b: RGBA (8b/comp) Ambient color0 specifications 0x100b Ambient1 32b: RGBA (8b/comp) Ambient color1 specifications 0x100c Material 0 32b: RGBA (8b/comp) global color0 material specifications 0x100d Material 1 32b: RGBF (8b/comp) global color1 material specification 0x100e Color0Cntrl B[0]: Color0 Material source 0: Use register (Material 0) 1: Use CP supplied Vertex color 0 B[1]: Color0 LightFunc 0: Use 1.0 1: Use Illum0 B[2]: Light0 is source 0: Do not use light 1: Use light B[3]: Light1 is source 0: Do not use light 1: Use light B[4]: Light2 is source 0: Do not use light 1: Use light B[5]: Light3 is source 0: Do not use light 1: Use light B[6]: Ambient source 0: Use register Ambient0 register 1: Use CP supplied vertex color 0 B[8:7]: DiffuseAtten function 0: Select 1.0 1: Select N.L, signed 2: Select N.L clamped to [0,1.0] B[9]: AttenEnable function 0: Select 1.0 1: Select Attenuation fraction B[10]: AttenSelect function 0: Select specular (N.H) attenuation 1: Select diffuse spotlight (L.Ldir) attenuation B[11]: Light4 is source 0: Do not use Light 1: Use light B[12]: Light 5 is source 0: Do not use Light 1: Use light B[13]: Light 6 is source 0: Do not use Light 1: Use light B[14]: Light 7 is source 0: Do not use Light 1: Use light 0x100f Color1Cntrl B[0]: Color Material source 0: Use register (Material 1) 1: Use CP supplied Vertex color 1 B[I]: Color1 LightFunc 0: Use 1.0 1: Use Illum1 B[2]: Light0 is source 0: Do not use light 1: Use light B[3]: Light1 is source 0: Do not use light 1: Use light B[4]: Light2 is source 0: Do not use light 1: Use light B[5]: Light3 is source 0: Do not use light 1: Use light B[6]: Ambient source 0: Use register Ambient1 register 1: Use CP supplied vertex color 1 B[8,7]: DiffuseAtten function 0: Select 1.0 1: Select N.L, signed 2: Select N.L clamped to [0,1.0] B[9]: AttenEnable function 0: Select 1.0 1: Select Attenuation fraction B[10]: AttenSelect function 0: Select specular (N.H) attenuation 1: Select diffuse spotlight (L.Ldir) attenuation B[11]: Light4 is source 0: Do not use Light 1: Use light B[12]: Light 5 is source 0: Do not use light 1: Use light B[13]: Light 6 is source 0: Do not use light 1: Use light B[14]: Light7 is source 0: Do not use light 1: Use light 0x1010 Alpha0Cntrl B[0]: Color0 alpha Material source 0: Use register (Material 0 alpha) 1: Use CP supplied Vertex color 0 alpha B[1]: Color0 alpha Light Func 0: Use 1.0 1: Use Illum0 B[2]: Light0 alpha is source 0: Do not use light 1: Use light B[3]: Light1 alpha is source 0: Do not use light 1: Use light B[4]: Light2 alpha is source 0: Do not use light 1: Use light B[5]: Light 3 alpha is source 0: Do not use light 1: Use light B[6]: Ambient source 0: Use register Ambient0 alpha register 1: Use CP supplied vertex color 0 alpha B[8:7]: DiffuseAtten function 0: Select 1.0 1: Select N.L, signed 2: Select N.L clamped to [0,1.0] B[9]: AttenEnable function 0: Select 1.0 1: Select Attenuation fraction B[1-]: AttenSelect function 0: Select specular (N.H) attenuation 1: Select diffuse spotlight (L.Ldir) attenuation B[11]: Light4 is source 0: Do not use Light 1:Use light B[12]: Light 5 is source 0: Do not use Light 1: Use Light B[13]: Light 6 is source 0: Do not use Light 1: Use light B[14]: Light 7 is source 0: Do not use Light 1: Use light 0x1011 Alpha1Cntrl B[0]: Color1 alpha Material source 0: Use CP supplied Vertex color 1 alpha B[I]: Color1 alpha LightFunc 0: Use 1.0 1: Use Illum0 B[2]: Light0 alpha is source 0: Do not use light 1: Use light B[3]: Light1 alpha is source 0: Do not use light 1: Use light B[4]: Light2 alpha is source 0: Do not use light 1: Use light B[5]: Light3 alpha is source 0: Do not use light 1: Use light B[6]: Ambient source 0: Use register Ambient1 alpha register 1: Use CP supplied vertex color 1 alpha B[8:7]: DiffuseAtten function 0: Select 1.0 1: Select N.L, signed 2: Select N.L clamped to [0,2.0] B[9]: AttenEnable function 0: Select 1.0 1: Se]ect Attenuation fraction B[10]: AttenSelect function 0: Select specular (N.H) attenuation 1: Select diffuse spotlight (L.Ldir) attenuation B[11]: Light 4 is source 0: Do not use Light 1: Use light B[12]: Light 5 is source 0: Do not use Light 1: Use light B[13]: Light 6 is source 0: Do not use Light 1: Use light B[14]: Light 7 is source 0: Do not use Light 1: Use light 0x1012 DualTexTran B[0]: When set(1), enables dual transform for all texture coordinates. When reset (0), disables dual texture transform feature [rev B] 0x1018 MatrixIndex0 B[5:0]: Geometry matrix index B[11:6]: Tex0 matrix index B[17:12]: Tex1 matrix index B[23:18]: Tex2 matrix index B[29:24]: Tex3 matrix index 0x1019 MatrixIndex1 B[5:0]: Tex4 matrix index B[11:6]: Tex5 matrix index B[17:12]: Tex6 matrix index B[23:18]: Tex7 matrix index 0x101a ScaleX Viewport scale X 0x101b ScaleY Viewport scale Y 0x101c ScaleZ Viewport scale Z 0x101d OffsetX Viewport offset X 0x101e OffsetY Viewport offset Y 0x101f OffsetZ Viewport offset Z 0x1020 ProjectionA A parameter in projection equations 0x1021 ProjectionB B parameter in projection equations 0x1022 ProjectionC C parameter in projectlon equations 0x1023 ProjectionD D parameter in projection equations 0x1024 ProjectionE E parameter in projection equations 0x1025 ProjectionF F parameter in projection equations 0x1026 ProjectOrtho If set selects orthographic otherwise non-orthographic (Zh or 1.0 select) 0x103f NumTex Number of active textures 0x1040 Tex0 B0: Reserved B1: texture projection 0: (s,t): texmul is 2x4 1: (s,t,q): texmul is 3x4 B2: input form (format of source input data
for regular textures) 0: (A, B, 1.0, 1.0) (used for regular texture source) 1: (A, B, C, 1.0) (used for geometry or normal source) B3: Reserved B[6,4]: texgen type 0: Regular transformation (transform incoming data) 1: texgen bump mapping 2: Color texgen: (s,t)=(r,g:b) (g and b are concatenated), color0 3: Color texgen: (s,t)=(r,g:b) (g and b are concatenated), color 1 B[11:7]: regular texture source row: Specifies location of incoming textures in vertex (row specific) (i.e.: geometry is row0, normal is row1, etc . . . ) for regular transformations (refer to the table below) B[14:12]: bump mapping source texture: n: use regular transformed tex(n) for bump mapping source B[17:15]: Bump mapping source light: n: use light #n for bump map direction source (10 to 17) 0x1041 Tex1 See Tex0 0x1042 Tex2 See Tex0 0x1043 Tex3 See Tex0 0x1044 Tex4 See Tex0 0x1045 Tex5 See Tex0 0x1046 Tex6 See Tex0 0x1047 Tex7 See Tex0 0x1050 Dual Tex0 B[5:0]: Indicates which is the base row of the dual transform matrix for regular texture coordinate0. [Rev B] B[7:6]: Not used. B[8]: specifies if texture coordinate should be normalized before send transform. 0x1051 DualTex1 See DualTex0 0x1052 DualTex2 See DualTex0 0x1053 DualTex3 See DualTex0 0x1054 DualTex4 See DualTex0 0x1055 DualTex5 See DualTex0 0x1056 DualTex6 See DualTex0 0x1057 DualTex7 See DualTex0
chan Color channel. enable Enable lighting for this color channel if enable = GX_ENABLE. amb_src Source for ambient color. mat_src Source for material color light_mask Lights used in the lighting equation for this channel. diff_fn Diffuse function for lighting attn_fn Attenuation function for lighting.
// Assumes vertex will supply color0. // init light position, direction, atten functions GxInitLightPosv( &myLightObj, &pos); GXInitLightDirv( &myLightObj, &dir); GxInitLightSpot( &myLightObj, 30.0f, GX_SP_COS2); GXInitLightDistAttn( &myLightObj, 100.0f, 0.5f, GX_DA_GENTLE); GXLoadLightObjImm( &myLightObj, GX_LIGHT0 ); GXSetChanAmbColor( GX_COLOR0, black); GXSetChanCtrl( GX_COLOR0, GX_TRUE, // enable lighting GX_SRC_REG, // ambient = 0 GX_SRC_VTX, // material color GX_LIGHT0, GX_DF_CLAMP, // normal diffuse light GX_AF_SPOT); // spot light attenuation // Set number of channels to light GXSetNumChans( 1 );
// Assumes vertex will supply color0. // init light direction, attn functions CXInitSpecularDirv( &myLightObj, &dir); GXInitLightShininess( &myLightObj, 5.0f); GxLoadLightObjImm( &myLightObj, GX_LIGHT0 ); GXSetChanAmbColor( GX_COLOR0, black ); GXSetChanCtrl( GX_COLOR0, GX_TRUE, // enable lighting GX_SRC_REG, // ambient = 0 GX_SRC_VTX // material color GX_LIGHT0, GX_DF_NONE, // no diffuse light GX_AF_SPEC); // specular light // Set number of channels to light GXSetNumChans( 1 );
// prepares large number (a2 pow 20) #define LARGE_NUMBER 1048576 // light direction on view space // the 3D vector (dx, dy, dz) is supporsed to be normalized. f32 dx, dy, dz; // init light parameters GXInitLightPos( &myLightObj, - dx * LARGE_NUMBER, - dy * LARGE_NUMBER, - dz * LARGE_NUMBER); GXInitLightColor( &myLightObj, white); GXLoadLightObjImm( &myLightObj, GX_LIGHT0 ); GXSetChanAmbColor( GX_COLOR0, ambColor); GXSetChanMatColor( GX_COLOR0, matColor); GXSetChanCtrl( GX_COLOR0, GX_TRUE, // enable lighting GX_SRC_REG, // ambient = black GX_SRC_REG, // material color GX_LIGHT0, GX_DF_CLAMP, // normal diffuse light GX_AF_NONE ); // no attenuation // Set number of channels to light GXSetNumChans( 1 );
// // Assumes vertex will supply color0 = pre-lit color. // GXInitLightColor( myLightObj, ScaleColor(myLitClr, 0.75)); // diffuse scale // // init light position, direction, atten functions // not shown GXLoadLightObjImm( myLightObj, GX_LIGHT0); GXSetChanAmbColor( GX_COLOR0, ScaleColor(white, 0.25)); // ambient scale GXSetChanCtrl( GX_COLOR0, GX_TRUE, // enable lighting GX_SRC_REG, // ambient scale GX_SRC_VTX, // mnaterial color = pre-lit color(vtx) GX_LIGHT0, GX_DF_CLAMP, // normal diffuse light GX_AF_SPOT); // spot light attenuation // // Set the material color register GXSetChanMatColor(.sup. GX_COLOR0, (GXColor){0xff,0x00,0x80,0xff}.sup. ); GXSetNumChans( 1 );
Function Parameters Description GXInitLightPos position (x, y, z) various GXInitLightColor color appropriate value channel ID always GX_COLOR0A0 channel enable always GX_ENABLE ambient source always register src GXSetChanCtrl material source always register src light mask always GX_LIGHT0 diffuse function always GX_DF_SIGN attenuation function always GX_AF_NONE GXSetChanAmbColor color appropriate value GXSetChanMatColor color appropriate value destination coord always GX_TEXCORD0 GXSetTexCoord Gen texgen function type always GX_TG_SRTG source always GX_TG_COOR0 matrix always GX_IDENTITY
![]() ![]() |
![]() ![]() ![]() ![]() |