2011-02-21 06:58:46 +00:00
|
|
|
/*
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
*
|
2011-11-29 10:54:47 +00:00
|
|
|
* This program is free software; you can redistribute it and/or
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2011-11-29 10:54:47 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
*
|
2011-11-29 10:54:47 +00:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2011-11-29 10:54:47 +00:00
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
*
|
|
|
|
* The Original Code is Copyright (C) 2005 Blender Foundation.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): Brecht Van Lommel.
|
|
|
|
*
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
*/
|
|
|
|
|
2011-02-21 06:58:46 +00:00
|
|
|
/** \file GPU_extensions.h
|
|
|
|
* \ingroup gpu
|
|
|
|
*/
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __GPU_EXTENSIONS_H__
|
|
|
|
#define __GPU_EXTENSIONS_H__
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct Image;
|
|
|
|
struct ImageUser;
|
2013-01-22 11:18:41 +00:00
|
|
|
struct PreviewImage;
|
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
struct GPUTexture;
|
|
|
|
typedef struct GPUTexture GPUTexture;
|
|
|
|
|
|
|
|
struct GPUFrameBuffer;
|
|
|
|
typedef struct GPUFrameBuffer GPUFrameBuffer;
|
|
|
|
|
2009-10-28 18:03:04 +00:00
|
|
|
struct GPUOffScreen;
|
|
|
|
typedef struct GPUOffScreen GPUOffScreen;
|
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
struct GPUShader;
|
|
|
|
typedef struct GPUShader GPUShader;
|
|
|
|
|
2010-01-31 23:45:51 +00:00
|
|
|
/* GPU extensions support */
|
|
|
|
|
2008-10-12 18:32:26 +00:00
|
|
|
void GPU_extensions_disable(void);
|
2010-04-05 10:25:40 +00:00
|
|
|
|
2015-03-16 22:57:56 -04:00
|
|
|
bool GPU_glsl_support(void);
|
|
|
|
bool GPU_non_power_of_two_support(void);
|
|
|
|
bool GPU_vertex_buffer_support(void);
|
|
|
|
bool GPU_display_list_support(void);
|
|
|
|
bool GPU_bicubic_bump_support(void);
|
2015-03-03 17:47:31 +01:00
|
|
|
bool GPU_geometry_shader_support(void);
|
|
|
|
bool GPU_instanced_drawing_support(void);
|
2015-03-16 22:57:56 -04:00
|
|
|
|
|
|
|
int GPU_max_texture_size(void);
|
2010-07-04 12:24:19 +00:00
|
|
|
int GPU_color_depth(void);
|
2015-03-16 22:57:56 -04:00
|
|
|
|
2011-12-15 13:58:09 +00:00
|
|
|
void GPU_code_generate_glsl_lib(void);
|
2013-04-12 17:56:07 +00:00
|
|
|
|
2010-01-31 23:45:51 +00:00
|
|
|
/* GPU Types */
|
|
|
|
|
|
|
|
typedef enum GPUDeviceType {
|
2015-03-23 15:29:42 -04:00
|
|
|
GPU_DEVICE_NVIDIA = (1<<0),
|
|
|
|
GPU_DEVICE_ATI = (1<<1),
|
|
|
|
GPU_DEVICE_INTEL = (1<<2),
|
|
|
|
GPU_DEVICE_SOFTWARE = (1<<3),
|
|
|
|
GPU_DEVICE_UNKNOWN = (1<<4),
|
|
|
|
GPU_DEVICE_ANY = (0xff)
|
2010-01-31 23:45:51 +00:00
|
|
|
} GPUDeviceType;
|
|
|
|
|
|
|
|
typedef enum GPUOSType {
|
2015-03-23 15:29:42 -04:00
|
|
|
GPU_OS_WIN = (1<<8),
|
|
|
|
GPU_OS_MAC = (1<<9),
|
|
|
|
GPU_OS_UNIX = (1<<10),
|
|
|
|
GPU_OS_ANY = (0xff00)
|
2010-01-31 23:45:51 +00:00
|
|
|
} GPUOSType;
|
|
|
|
|
|
|
|
typedef enum GPUDriverType {
|
2015-03-23 15:29:42 -04:00
|
|
|
GPU_DRIVER_OFFICIAL = (1<<16),
|
2010-07-16 10:13:04 +00:00
|
|
|
GPU_DRIVER_OPENSOURCE = (1<<17),
|
2015-03-23 15:29:42 -04:00
|
|
|
GPU_DRIVER_SOFTWARE = (1<<18),
|
|
|
|
GPU_DRIVER_ANY = (0xff0000)
|
2010-01-31 23:45:51 +00:00
|
|
|
} GPUDriverType;
|
|
|
|
|
2015-03-16 22:57:56 -04:00
|
|
|
bool GPU_type_matches(GPUDeviceType device, GPUOSType os, GPUDriverType driver);
|
2010-01-31 23:45:51 +00:00
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
/* GPU Texture
|
2012-03-09 18:28:30 +00:00
|
|
|
* - always returns unsigned char RGBA textures
|
|
|
|
* - if texture with non square dimensions is created, depending on the
|
|
|
|
* graphics card capabilities the texture may actually be stored in a
|
|
|
|
* larger texture with power of two dimensions. the actual dimensions
|
|
|
|
* may be queried with GPU_texture_opengl_width/height. GPU_texture_coord_2f
|
|
|
|
* calls glTexCoord2f with the coordinates adjusted for this.
|
|
|
|
* - can use reference counting:
|
|
|
|
* - reference counter after GPU_texture_create is 1
|
|
|
|
* - GPU_texture_ref increases by one
|
|
|
|
* - GPU_texture_free decreases by one, and frees if 0
|
|
|
|
* - if created with from_blender, will not free the texture
|
|
|
|
*/
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
|
2015-02-12 18:54:41 +01:00
|
|
|
typedef enum GPUHDRType {
|
|
|
|
GPU_HDR_NONE = 0,
|
|
|
|
GPU_HDR_HALF_FLOAT = 1,
|
|
|
|
GPU_HDR_FULL_FLOAT = (1 << 1),
|
|
|
|
} GPUHDRType;
|
|
|
|
|
2015-03-16 22:57:56 -04:00
|
|
|
GPUTexture *GPU_texture_create_1D(int w, const float *pixels, char err_out[256]);
|
|
|
|
GPUTexture *GPU_texture_create_2D(int w, int h, const float *pixels, GPUHDRType hdr, char err_out[256]);
|
|
|
|
GPUTexture *GPU_texture_create_3D(int w, int h, int depth, int channels, const float *fpixels);
|
2011-03-06 23:12:12 +00:00
|
|
|
GPUTexture *GPU_texture_create_depth(int w, int h, char err_out[256]);
|
2012-05-01 02:50:17 +00:00
|
|
|
GPUTexture *GPU_texture_create_vsm_shadow_map(int size, char err_out[256]);
|
2015-03-03 17:47:31 +01:00
|
|
|
GPUTexture *GPU_texture_create_2D_procedural(int w, int h, const float *pixels, bool repeat, char err_out[256]);
|
2015-03-16 22:57:56 -04:00
|
|
|
GPUTexture *GPU_texture_create_1D_procedural(int w, const float *pixels, char err_out[256]);
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
GPUTexture *GPU_texture_from_blender(struct Image *ima,
|
2014-04-01 11:34:00 +11:00
|
|
|
struct ImageUser *iuser, bool is_data, double time, int mipmap);
|
2013-01-22 11:18:41 +00:00
|
|
|
GPUTexture *GPU_texture_from_preview(struct PreviewImage *prv, int mipmap);
|
2014-06-10 01:36:53 +03:00
|
|
|
void GPU_invalid_tex_init(void);
|
|
|
|
void GPU_invalid_tex_bind(int mode);
|
|
|
|
void GPU_invalid_tex_free(void);
|
2013-01-22 11:18:41 +00:00
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
void GPU_texture_free(GPUTexture *tex);
|
|
|
|
|
|
|
|
void GPU_texture_ref(GPUTexture *tex);
|
|
|
|
|
|
|
|
void GPU_texture_bind(GPUTexture *tex, int number);
|
|
|
|
void GPU_texture_unbind(GPUTexture *tex);
|
|
|
|
|
2015-03-03 17:47:31 +01:00
|
|
|
void GPU_texture_filter_mode(GPUTexture *tex, bool compare, bool use_filter);
|
2015-02-12 18:54:41 +01:00
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
GPUFrameBuffer *GPU_texture_framebuffer(GPUTexture *tex);
|
|
|
|
|
2015-03-16 22:57:56 -04:00
|
|
|
int GPU_texture_target(const GPUTexture *tex);
|
|
|
|
int GPU_texture_opengl_width(const GPUTexture *tex);
|
|
|
|
int GPU_texture_opengl_height(const GPUTexture *tex);
|
|
|
|
int GPU_texture_opengl_bindcode(const GPUTexture *tex);
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
|
|
|
|
/* GPU Framebuffer
|
2012-03-09 18:28:30 +00:00
|
|
|
* - this is a wrapper for an OpenGL framebuffer object (FBO). in practice
|
|
|
|
* multiple FBO's may be created, to get around limitations on the number
|
|
|
|
* of attached textures and the dimension requirements.
|
|
|
|
* - after any of the GPU_framebuffer_* functions, GPU_framebuffer_restore must
|
|
|
|
* be called before rendering to the window framebuffer again */
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
|
2014-11-18 12:37:55 +01:00
|
|
|
void GPU_texture_bind_as_framebuffer(GPUTexture *tex);
|
|
|
|
|
2010-12-03 12:30:59 +00:00
|
|
|
GPUFrameBuffer *GPU_framebuffer_create(void);
|
2014-11-18 11:56:23 +01:00
|
|
|
int GPU_framebuffer_texture_attach(GPUFrameBuffer *fb, GPUTexture *tex, int slot, char err_out[256]);
|
|
|
|
void GPU_framebuffer_texture_detach(GPUTexture *tex);
|
2015-02-12 18:54:41 +01:00
|
|
|
void GPU_framebuffer_slots_bind(GPUFrameBuffer *fb, int slot);
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
void GPU_framebuffer_texture_unbind(GPUFrameBuffer *fb, GPUTexture *tex);
|
|
|
|
void GPU_framebuffer_free(GPUFrameBuffer *fb);
|
2014-11-25 16:16:50 +01:00
|
|
|
bool GPU_framebuffer_check_valid(GPUFrameBuffer *fb, char err_out[256]);
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
|
2015-02-12 18:54:41 +01:00
|
|
|
void GPU_framebuffer_bind_no_save(GPUFrameBuffer *fb, int slot);
|
|
|
|
|
2010-12-03 12:30:59 +00:00
|
|
|
void GPU_framebuffer_restore(void);
|
2012-05-01 02:50:17 +00:00
|
|
|
void GPU_framebuffer_blur(GPUFrameBuffer *fb, GPUTexture *tex, GPUFrameBuffer *blurfb, GPUTexture *blurtex);
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
|
2009-10-28 18:03:04 +00:00
|
|
|
/* GPU OffScreen
|
2012-03-09 18:28:30 +00:00
|
|
|
* - wrapper around framebuffer and texture for simple offscreen drawing
|
|
|
|
* - changes size if graphics card can't support it */
|
2009-10-28 18:03:04 +00:00
|
|
|
|
2011-10-28 16:57:06 +00:00
|
|
|
GPUOffScreen *GPU_offscreen_create(int width, int height, char err_out[256]);
|
2009-10-28 18:03:04 +00:00
|
|
|
void GPU_offscreen_free(GPUOffScreen *ofs);
|
2015-02-12 18:54:41 +01:00
|
|
|
void GPU_offscreen_bind(GPUOffScreen *ofs, bool save);
|
|
|
|
void GPU_offscreen_unbind(GPUOffScreen *ofs, bool restore);
|
2011-10-28 16:57:06 +00:00
|
|
|
void GPU_offscreen_read_pixels(GPUOffScreen *ofs, int type, void *pixels);
|
2015-03-16 22:57:56 -04:00
|
|
|
int GPU_offscreen_width(const GPUOffScreen *ofs);
|
|
|
|
int GPU_offscreen_height(const GPUOffScreen *ofs);
|
2009-10-28 18:03:04 +00:00
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
/* GPU Shader
|
2012-03-09 18:28:30 +00:00
|
|
|
* - only for fragment shaders now
|
|
|
|
* - must call texture bind before setting a texture as uniform! */
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
|
2015-03-20 15:26:13 +01:00
|
|
|
GPUShader *GPU_shader_create(const char *vertexcode, const char *fragcode, const char *geocode, const char *libcode, const char *defines, int input, int output, int number);
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
void GPU_shader_free(GPUShader *shader);
|
|
|
|
|
|
|
|
void GPU_shader_bind(GPUShader *shader);
|
2013-02-26 00:49:42 +00:00
|
|
|
void GPU_shader_unbind(void);
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
|
2010-12-03 17:05:21 +00:00
|
|
|
int GPU_shader_get_uniform(GPUShader *shader, const char *name);
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
void GPU_shader_uniform_vector(GPUShader *shader, int location, int length,
|
2015-02-12 18:54:41 +01:00
|
|
|
int arraysize, const float *value);
|
2015-03-03 17:47:31 +01:00
|
|
|
void GPU_shader_uniform_vector_int(GPUShader *shader, int location, int length,
|
|
|
|
int arraysize, const int *value);
|
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
void GPU_shader_uniform_texture(GPUShader *shader, int location, GPUTexture *tex);
|
2013-02-26 00:49:42 +00:00
|
|
|
void GPU_shader_uniform_int(GPUShader *shader, int location, int value);
|
2015-03-03 17:47:31 +01:00
|
|
|
void GPU_shader_geometry_stage_primitive_io(GPUShader *shader, int input, int output, int number);
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
|
2012-01-11 09:33:44 +00:00
|
|
|
int GPU_shader_get_attribute(GPUShader *shader, const char *name);
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
|
2012-05-01 02:50:17 +00:00
|
|
|
/* Builtin/Non-generated shaders */
|
|
|
|
typedef enum GPUBuiltinShader {
|
2015-03-23 15:29:42 -04:00
|
|
|
GPU_SHADER_VSM_STORE = (1<<0),
|
|
|
|
GPU_SHADER_SEP_GAUSSIAN_BLUR = (1<<1),
|
2012-05-01 02:50:17 +00:00
|
|
|
} GPUBuiltinShader;
|
|
|
|
|
|
|
|
GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader shader);
|
2015-02-12 18:54:41 +01:00
|
|
|
GPUShader *GPU_shader_get_builtin_fx_shader(int effects, bool persp);
|
|
|
|
|
2012-05-01 06:50:43 +00:00
|
|
|
void GPU_shader_free_builtin_shaders(void);
|
2012-05-01 02:50:17 +00:00
|
|
|
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
/* Vertex attributes for shaders */
|
|
|
|
|
2015-03-23 15:29:42 -04:00
|
|
|
#define GPU_MAX_ATTRIB 32
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
|
|
|
|
typedef struct GPUVertexAttribs {
|
|
|
|
struct {
|
|
|
|
int type;
|
|
|
|
int glindex;
|
2011-08-12 18:17:28 +00:00
|
|
|
int gltexco;
|
2011-09-09 11:55:38 +00:00
|
|
|
int attribid;
|
2012-01-11 08:51:06 +00:00
|
|
|
char name[64]; /* MAX_CUSTOMDATA_LAYER_NAME */
|
Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:
* GLSL support in the viewport and game engine, enable in the game
menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.
* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
An extra texture slot shows up once the last slot is used.
* Memory limit for undo, not enabled by default yet because it
needs the .B.blend to be changed.
* Multiple undo for image painting.
* An offset for dupligroups, so not all objects in a group have to
be at the origin.
2008-09-04 20:51:28 +00:00
|
|
|
} layer[GPU_MAX_ATTRIB];
|
|
|
|
|
|
|
|
int totlayer;
|
|
|
|
} GPUVertexAttribs;
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-04-16 05:46:17 +00:00
|
|
|
#endif /* __GPU_EXTENSIONS_H__ */
|