From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

The Basic Aspect

Header File: GPU_basic.h

Switching

Switch to the Basic drawing aspect by calling GPU_aspect_begin(GPU_ASPECT_BASIC, NULL).

The Basic aspect is begun by GPU_init and all code that changes the current aspect will change the aspect back to Basic before exiting. This allows drawing code to assume the Basic aspect and only change to other aspects when needed.

Feature Flags

typedef enum GPUBasicOption {
	GPU_BASIC_LIGHTING     = (1<<0), /* do lighting computations                */
	GPU_BASIC_TWO_SIDE     = (1<<1), /* flip back-facing normals towards viewer */
	GPU_BASIC_TEXTURE_2D   = (1<<2), /* use 2D texture to replace diffuse color */
	GPU_BASIC_LOCAL_VIEWER = (1<<3), /* use for orthographic projection         */
	GPU_BASIC_SMOOTH       = (1<<4), /* use smooth shading                      */
	GPU_BASIC_ALPHATEST    = (1<<5), /* use alpha test                          */
} GPUBasicOption;

These options are passed into GPU_aspect_enable(GPU_ASPECT_BASIC, ...) and GPU_aspect_disable(GPU_ASPECT_BASIC, ...)

Normals

bool GPU_basic_needs_normals(void);

This function is used to determine if normals should be sent to the OpenGL for lighting.