Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/GPU_vertex_format.h
| Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | |||||
| /** | /** | ||||
| * This makes the "virtual" attributes with suffixes "0", "1", "2" to access triangle data in the vertex | * This makes the "virtual" attributes with suffixes "0", "1", "2" to access triangle data in the vertex | ||||
| * shader. | * shader. | ||||
| * | * | ||||
| * IMPORTANT: | * IMPORTANT: | ||||
| * - Call this before creating the vertex buffer and after creating all attributes | * - Call this before creating the vertex buffer and after creating all attributes | ||||
| * - Only first vertex out of 3 has the correct information. Use flat output with GL_FIRST_VERTEX_CONVENTION. | * - Only first vertex out of 3 has the correct information. Use flat output with GL_FIRST_VERTEX_CONVENTION. | ||||
| **/ | */ | ||||
| void GPU_vertformat_triple_load(GPUVertFormat *format); | void GPU_vertformat_triple_load(GPUVertFormat *format); | ||||
| /* format conversion */ | /* format conversion */ | ||||
| typedef struct GPUPackedNormal { | typedef struct GPUPackedNormal { | ||||
| int x : 10; | int x : 10; | ||||
| int y : 10; | int y : 10; | ||||
| int z : 10; | int z : 10; | ||||
| int w : 2; /* 0 by default, can manually set to { -2, -1, 0, 1 } */ | int w : 2; /* 0 by default, can manually set to { -2, -1, 0, 1 } */ | ||||
| } GPUPackedNormal; | } GPUPackedNormal; | ||||
| GPUPackedNormal GPU_normal_convert_i10_v3(const float data[3]); | GPUPackedNormal GPU_normal_convert_i10_v3(const float data[3]); | ||||
| GPUPackedNormal GPU_normal_convert_i10_s3(const short data[3]); | GPUPackedNormal GPU_normal_convert_i10_s3(const short data[3]); | ||||
| #endif /* __GPU_VERTEX_FORMAT_H__ */ | #endif /* __GPU_VERTEX_FORMAT_H__ */ | ||||