Changes between Initial Version and Version 1 of Ticket #955
- Timestamp:
- 03/24/11 14:09:22 (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #955
- Property Status changed from new to assigned
- Property Owner set to ArcRiley
-
Ticket #955 – Description
initial v1 3 3 After several attempts to improve it, and realizing that many of these prospective features conflict with each other, it's time to break it up into more refined classes, for now including Material, Textured, and Bumpmapped. 4 4 5 '''Material''' will have just the basic colors properties. No textures, no cell shading, no adjustable shades beyond 0 (smooth) and 1 (flat), no blurring, no refraction, no metalic effects, and only the most basic alpha translucency. 5 '''Material''' will be a plain greyish white material as the default for new faces. 6 7 '''Colored''' will have just the basic colors properties. No textures, no cell shading, no adjustable shades beyond 0 (smooth) and 1 (flat), no blurring, no refraction, no metalic effects, and only the most basic alpha translucency. 6 8 7 9 '''Textured''' will inherit Material and add support for colormap and glowmap textures. … … 13 15 To accommodate this in a sane manner, the bind/unbind API needs to be replaced with a more flexible system: 14 16 15 cdef int _render(self, int _pass, float* _texcoords, float* _tslvs) 17 def virtual render (pass : int, texcoords : array of float, 18 tslvs : array of float) : bool 16 19 17 _pass is the pass number, starting with zero20 pass is the pass number, starting with zero 18 21 19 _texcoords are the vertices' standard texcoords strided by 48 bytes, it's up to Material._render to set the pointer for any texture that needs this22 texcoords are the vertices' standard texcoords strided by 48 bytes, it's up to Material._render to set the pointer for any texture that needs this 20 23 21 _tslvs are the Tangent-Space-Light-Vectors with a 0 stride. This is needed for bumpmaps and possibly other types of materials (ie, for a chrome effect)24 tslvs are the Tangent-Space-Light-Vectors with a 0 stride. This is needed for bumpmaps and possibly other types of materials (ie, for a chrome effect) 22 25 23 If the function returns a 1, a render pass will done and this function called again. 0 is returned after a cleanup "pass" and is not followed by actual rendering. Thus:26 If the function returns true, a render pass will done and this function called again. False is returned if no further rendering or cleanup is needed. Thus: 24 27 {{{ 25 _pass = 026 while (material. _render(_pass, _texcoords, _tslvs):27 gl.glDrawElements (gl.GL_TRIANGLES,28 length * 3,29 gl.GL_UNSIGNED_SHORT,30 offset)31 _pass += 128 pass = 0 29 while (material.render(pass, texcoords, tslvs): 30 gl.glDrawElements (gl.GL_TRIANGLES, 31 length * 3, 32 gl.GL_UNSIGNED_SHORT, 33 offset) 34 pass += 1 32 35 }}} 33 36 34 Each material is responsible for enabling each texture unit used, disabling those unused, setting the blend mode and function, enabling/disabling each of it 's textures, and setting each of it's texture environment parameters.37 Each material is responsible for enabling each texture unit used, disabling those unused, setting the blend mode and function, enabling/disabling each of its textures, and setting each of its texture environment parameters.



