36 template<
int category>
41 std::string saved_loc;
43 explicit ScopedLocale(
const char *locale)
45 const char *old_loc = setlocale(category, locale);
46 if (old_loc ==
nullptr)
47 throw std::invalid_argument(
"Argument to setlocale was invalid");
52 setlocale(category, saved_loc.c_str());
62 StdStrBuf Texture2DToCode(
int index,
bool hasTextureAnimation)
64 if (hasTextureAnimation)
return FormatString(
"texture(oc_Texture%d, (oc_TextureMatrix%d * vec4(texcoord, 0.0, 1.0)).xy)", index, index);
65 return FormatString(
"texture(oc_Texture%d, texcoord)", index);
78 default: assert(
false);
return StdStrBuf(
"vec4(0.0, 0.0, 0.0, 0.0)");
99 case StdMeshMaterialTextureUnit::BOX_Dotproduct:
return FormatString(
"vec3(4.0 * dot(%s - 0.5, %s - 0.5), 4.0 * dot(%s - 0.5, %s - 0.5), 4.0 * dot(%s - 0.5, %s - 0.5))", source1, source2, source1, source2, source1, source2);
101 default: assert(
false);
return StdStrBuf(source1);
107 ScopedLocale<LC_NUMERIC> scoped_c_locale(
"C");
115 return FormatString(
"currentColor = vec4(%s, %s);\n", TextureUnitBlendToCode(index, texunit.
ColorOpEx, color_source1.
getData(), color_source2.
getData(), texunit.
ColorOpManualFactor, hasTextureAnimation).getData(), TextureUnitBlendToCode(index, texunit.
AlphaOpEx, alpha_source1.
getData(), alpha_source2.
getData(), texunit.
AlphaOpManualFactor, hasTextureAnimation).getData());
120 ScopedLocale<LC_NUMERIC> scoped_c_locale(
"C");
160 default: assert(
false);
return GL_ZERO;
172 "attribute vec3 oc_Position;\n"
173 "attribute vec3 oc_Normal;\n"
174 "attribute vec2 oc_TexCoord;\n"
175 "varying vec3 vtxNormal;\n"
176 "varying vec2 texcoord;\n"
177 "uniform mat4 projectionMatrix;\n"
178 "uniform mat4 modelviewMatrix;\n"
179 "uniform mat3 normalMatrix;\n"
183 " gl_Position = projectionMatrix * modelviewMatrix * vec4(oc_Position, 1.0);\n"
188 " texcoord = oc_TexCoord;\n"
193 " vtxNormal = normalize(normalMatrix * oc_Normal);\n"
199 buf.
Take(
StdStrBuf(
"#define OC_WA_FORCE_SOFTWARE_TRANSFORM\n") + buf);
201 if (LowMaxVertexUniformCount)
202 return StdStrBuf(
"#define OC_WA_LOW_MAX_VERTEX_UNIFORM_COMPONENTS\n") + buf;
216 unsigned int texIndex = 0;
217 StdStrBuf textureUnitCode(
""), textureUnitDeclCode(
"");
220 textureUnitCode.Append(TextureUnitToCode(texIndex, texunit));
224 textureUnitDeclCode.Append(
FormatString(
"uniform sampler2D oc_Texture%u;\n", texIndex).getData());
231 textureUnitDeclCode.Append(
FormatString(
"uniform mat4 oc_TextureMatrix%u;\n", texIndex).getData());
241 "uniform vec3 oc_PlayerColor;\n"
245 " vec4 diffuse = fragColor;\n"
246 " vec4 currentColor = diffuse;\n"
248 " fragColor = currentColor;\n"
255 textureUnitDeclCode.getData(),
256 textureUnitCode.getData(),
257 AlphaTestToCode(pass).getData()
261 StdStrBuf GetSHA1HexDigest(
const char*
text, std::size_t len)
265 unsigned int digest[5];
268 return FormatString(
"%08x%08x%08x%08x%08x", digest[0], digest[1], digest[2], digest[3], digest[4]);
279 for (
unsigned int i = 0; i < mat.
Techniques.size(); ++i)
283 for (
unsigned int j = 0; j < technique.
Passes.size(); ++j)
287 GLint max_texture_units;
288 glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &max_texture_units);
292 assert(max_texture_units >= 16);
293 max_texture_units = std::min<GLint>(max_texture_units, 16);
295 unsigned int active_texture_units = 0;
297 if(TextureUnit.HasTexture())
298 ++active_texture_units;
300 if (active_texture_units >
static_cast<unsigned int>(max_texture_units))
308 glBindTexture(GL_TEXTURE_2D, texture.
texName);
312 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
313 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
316 glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, texunit.
TexBorderColor);
319 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
320 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
323 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_MIRRORED_REPEAT);
324 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_MIRRORED_REPEAT);
337 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
340 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
343 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_LINEAR);
354 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
357 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
360 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
379 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
382 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
396 bool custom_shader =
true;
402 custom_shader =
false;
420 if (!custom_shader && !
Workarounds.LowMaxVertexUniformCount)
422 StdStrBuf buf = GetVertexShaderCodeForPass(pass,
true);
432 Log(
" gl: Enabling low max vertex uniform workaround");
444 pass.
Program = std::move(program_instance);
464 Translate(projection, ZoomX, ZoomY, 0.0f);
465 Scale(projection, Zoom, Zoom, 1.0f);
466 Translate(projection, -ZoomX, -ZoomY, 0.0f);
472 transform(0, 0) = pTransform->
mat[0];
473 transform(0, 1) = pTransform->
mat[1];
474 transform(0, 2) = 0.0f;
475 transform(0, 3) = pTransform->
mat[2];
476 transform(1, 0) = pTransform->
mat[3];
477 transform(1, 1) = pTransform->
mat[4];
478 transform(1, 2) = 0.0f;
479 transform(1, 3) = pTransform->
mat[5];
480 transform(2, 0) = 0.0f;
481 transform(2, 1) = 0.0f;
482 transform(2, 2) = 1.0f;
483 transform(2, 3) = 0.0f;
484 transform(3, 0) = pTransform->
mat[6];
485 transform(3, 1) = pTransform->
mat[7];
486 transform(3, 2) = 0.0f;
487 transform(3, 3) = pTransform->
mat[8];
488 projection *= transform;
492 const float det = transform(0,0)*transform(1,1)*transform(3,3)
493 + transform(1,0)*transform(3,1)*transform(0,3)
494 + transform(3,0)*transform(0,1)*transform(1,3)
495 - transform(0,0)*transform(3,1)*transform(1,3)
496 - transform(1,0)*transform(0,1)*transform(3,3)
497 - transform(3,0)*transform(1,1)*transform(0,3);
508 const float fMod[4] = {
509 ((dwModClr >> 16) & 0xff) / 255.0f,
510 ((dwModClr >> 8) & 0xff) / 255.0f,
511 ((dwModClr ) & 0xff) / 255.0f,
512 ((dwModClr >> 24) & 0xff) / 255.0f
519 const float fPlrClr[3] = {
520 ((dwPlayerColor >> 16) & 0xff) / 255.0f,
521 ((dwPlayerColor >> 8) & 0xff) / 255.0f,
522 ((dwPlayerColor ) & 0xff) / 255.0f,
534 float lightTransform[6];
541 float ambientTransform[6];
559 assert(passIndex < technique.
Passes.size());
571 switch (trans.TransformType)
574 Translate(matrix, trans.Scroll.X, trans.Scroll.Y, 0.0f);
577 Translate(matrix, trans.GetScrollX(Position), trans.GetScrollY(Position), 0.0f);
580 Rotate(matrix, trans.Rotate.Angle, 0.0f, 0.0f, 1.0f);
583 Rotate(matrix, trans.GetRotate(Position), 0.0f, 0.0f, 1.0f);
586 Scale(matrix, trans.Scale.X, trans.Scale.Y, 1.0f);
589 for (
int i = 0; i < 16; ++i)
590 temp_matrix(i / 4, i % 4) = trans.Transform.M[i];
591 matrix *= temp_matrix;
594 switch (trans.WaveXForm.XForm)
597 Translate(matrix, trans.GetWaveXForm(Position), 0.0f, 0.0f);
600 Translate(matrix, 0.0f, trans.GetWaveXForm(Position), 0.0f);
603 Rotate(matrix, trans.GetWaveXForm(Position), 0.0f, 0.0f, 1.0f);
606 Scale(matrix, trans.GetWaveXForm(Position), 1.0f, 1.0f);
609 Scale(matrix, 1.0f, trans.GetWaveXForm(Position), 1.0f);
624 std::vector<BoneTransform> CookBoneTransforms(
const StdMeshInstance& mesh_instance)
629 std::vector<BoneTransform> bones;
632 #pragma clang diagnostic ignored "-Wmissing-braces"
634 static const BoneTransform dummy_bone = {
635 1.0f, 0.0f, 0.0f, 0.0f,
636 0.0f, 1.0f, 0.0f, 0.0f,
637 0.0f, 0.0f, 1.0f, 0.0f
639 bones.push_back(dummy_bone);
644 for (
size_t bone_index = 0; bone_index < mesh_instance.
GetBoneCount(); ++bone_index)
647 BoneTransform cooked_bone = {
648 bone(0, 0), bone(0, 1), bone(0, 2), bone(0, 3),
649 bone(1, 0), bone(1, 1), bone(1, 2), bone(1, 3),
650 bone(2, 0), bone(2, 1), bone(2, 2), bone(2, 3)
652 bones.push_back(cooked_bone);
658 struct PretransformedMeshVertex
679 PretransformedMeshVertex vtx{ 0, 0, 0, 0, 0, 0 };
684 auto vertex = weight * (bone * in);
699 glBindBuffer(GL_ARRAY_BUFFER, vbo);
702 const size_t vertex_count = original_vertices.size();
707 glBufferData(GL_ARRAY_BUFFER, vertex_count *
sizeof(PretransformedMeshVertex),
nullptr, GL_STREAM_DRAW);
708 void *map = glMapBuffer(GL_ARRAY_BUFFER, GL_WRITE_ONLY);
709 PretransformedMeshVertex *buffer =
new (map) PretransformedMeshVertex[vertex_count];
711 for (
size_t i = 0; i < vertex_count; ++i)
713 PretransformMeshVertex(&buffer[i], original_vertices[i], mesh_instance);
715 }
while (glUnmapBuffer(GL_ARRAY_BUFFER) == GL_FALSE);
717 glBindBuffer(GL_ARRAY_BUFFER, 0);
720 void RenderSubMeshImpl(
const StdProjectionMatrix& projectionMatrix,
const StdMeshMatrix& modelviewMatrix,
const StdMeshInstance& mesh_instance,
const StdSubMeshInstance& instance,
DWORD dwModClr,
DWORD dwBlitMode,
DWORD dwPlayerColor,
const C4FoWRegion* pFoW,
const C4Rect& clipRect,
const C4Rect& outRect,
bool parity)
732 GLuint ibo = mesh_instance.
GetIBO();
733 unsigned int vaoid = mesh_instance.
GetVAOID();
737 const bool ForceSoftwareTransform =
pGL->
Workarounds.ForceSoftwareTransform;
738 GLuint pretransform_vbo;
740 std::vector<BoneTransform> bones;
741 if (!ForceSoftwareTransform)
743 bones = CookBoneTransforms(mesh_instance);
747 glGenBuffers(1, &pretransform_vbo);
748 PretransformMeshVertices(mesh_instance, instance, pretransform_vbo);
754 for (
unsigned int i = 0; i < technique.
Passes.size(); ++i)
759 glDisable(GL_DEPTH_TEST);
761 glDepthMask(pass.
DepthWrite ? GL_TRUE : GL_FALSE);
764 glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE);
766 glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
768 glFrontFace(parity ? GL_CW : GL_CCW);
773 glDisable(GL_CULL_FACE);
780 glEnable(GL_CULL_FACE);
784 glEnable(GL_CULL_FACE);
785 glCullFace(GL_FRONT);
788 glDisable(GL_CULL_FACE);
799 if (((dwModClr >> 24) & 0xff) < 0xff)
800 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
807 if (((dwModClr >> 24) & 0xff) < 0xff)
808 glBlendFunc(GL_SRC_ALPHA, GL_ONE);
813 assert(pass.
Program.get() !=
nullptr);
818 if (pFoW !=
nullptr) ssc |= C4SSC_LIGHT;
838 if (!ForceSoftwareTransform)
850 const bool has_vao =
pGL->
GetVAO(vaoid, vao);
851 glBindVertexArray(vao);
861 glBindBuffer(GL_ARRAY_BUFFER, vbo);
862 glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ibo);
863 #define VERTEX_OFFSET(field) reinterpret_cast<const uint8_t *>(offsetof(StdMeshVertex, field))
866 if (!ForceSoftwareTransform)
888 if (ForceSoftwareTransform)
890 glBindBuffer(GL_ARRAY_BUFFER, pretransform_vbo);
891 #define VERTEX_OFFSET(field) reinterpret_cast<const uint8_t *>(offsetof(PretransformedMeshVertex, field))
897 glBindBuffer(GL_ARRAY_BUFFER, 0);
901 for (
unsigned int j = 0; j < pass.
TextureUnits.size(); ++j)
914 for(
auto & Parameter : pass.
Program->Parameters)
916 const int uniform = Parameter.UniformIndex;
924 if(!ResolveAutoParameter(call, auto_resolved, parameter->
GetAuto(), dwModClr, dwPlayerColor, dwBlitMode, pFoW, clipRect))
926 parameter = &auto_resolved;
962 size_t base_vertex = vertex_buffer_offset /
sizeof(
StdMeshVertex);
963 glDrawElementsBaseVertex(GL_TRIANGLES, vertex_count, GL_UNSIGNED_INT,
reinterpret_cast<void*
>(index_buffer_offset), base_vertex);
964 glBindVertexArray(0);
968 glEnable(GL_DEPTH_TEST);
971 if (ForceSoftwareTransform)
972 glDeleteBuffers(1, &pretransform_vbo);
985 if(denumerator && denumerator->
GetObject())
993 StdMeshMatrix newModelviewMatrix = modelviewMatrix * FinalTrans;
994 RenderMeshImpl(projectionMatrix, newModelviewMatrix, *attach->
Child, dwModClr, dwBlitMode, dwPlayerColor, pFoW, clipRect, outRect, parity);
1005 RenderAttachedMesh(projectionMatrix, modelviewMatrix, *attach_iter, dwModClr, dwBlitMode, dwPlayerColor, pFoW, clipRect, outRect, parity);
1009 glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
1013 RenderSubMeshImpl(projectionMatrix, modelviewMatrix, instance, instance.
GetSubMeshOrdered(i), dwModClr, dwBlitMode, dwPlayerColor, pFoW, clipRect, outRect, parity);
1017 glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
1021 RenderAttachedMesh(projectionMatrix, modelviewMatrix, *attach_iter, dwModClr, dwBlitMode, dwPlayerColor, pFoW, clipRect, outRect, parity);
1028 static const float FOV = 60.0f;
1029 static const float TAN_FOV = tan(FOV / 2.0f / 180.0f * M_PI);
1032 bool mesh_transform_parity =
false;
1036 if (fabs(det) < 1e-6)
1038 else if (det < 0.0f)
1039 mesh_transform_parity =
true;
1044 bool parity =
false;
1050 v1.
x = box.
x1; v1.
y = box.
y1; v1.
z = box.
z1;
1051 v2.
x = box.
x2; v2.
y = box.
y2; v2.
z = box.
z2;
1056 glEnable(GL_DEPTH_TEST);
1069 const float b = fabs(v2.
x - v1.
x)/2.0f;
1070 const float h = fabs(v2.
y - v1.
y)/2.0f;
1071 const float l = fabs(v2.
z - v1.
z)/2.0f;
1082 if (!ApplyZoomAndTransform(
ZoomX,
ZoomY,
Zoom, pTransform, projectionMatrix))
1086 const float rx = -std::min(v1.
x,v2.
x) / fabs(v2.
x - v1.
x);
1087 const float ry = -std::min(v1.
y,v2.
y) / fabs(v2.
y - v1.
y);
1088 const float dx = tx + rx*twdt;
1089 const float dy = ty + ry*thgt;
1112 Translate(projectionMatrix, dx, dy, 0.0f);
1113 Scale(projectionMatrix, 1.0f, 1.0f, scz);
1123 Translate(projectionMatrix, -1.0f, 1.0f, 0.0f);
1124 Scale(projectionMatrix, 2.0f/clipRect.
Wdt, -2.0f/clipRect.
Hgt, 1.0f);
1126 Translate(projectionMatrix, -clipRect.
x, -clipRect.
y, 0.0f);
1127 if (!ApplyZoomAndTransform(
ZoomX,
ZoomY,
Zoom, pTransform, projectionMatrix))
1131 float ttx = tx, tty = ty, ttwdt = twdt, tthgt = thgt;
1134 tty += (thgt-twdt)/2.0;
1139 ttx += (twdt-thgt)/2.0;
1143 Translate(projectionMatrix, ttx, tty, 0.0f);
1144 Scale(projectionMatrix, ((
float)ttwdt)/clipRect.
Wdt, ((
float)tthgt)/clipRect.
Hgt, 1.0f);
1147 Scale(projectionMatrix, clipRect.
Wdt/2.0, -clipRect.
Hgt/2.0, 1.0f);
1148 Translate(projectionMatrix, 1.0f, -1.0f, 0.0f);
1151 const float ta = twdt / thgt;
1152 const float ma =
b / h;
1153 if(ta <= 1 && ta/ma <= 1)
1154 Scale(projectionMatrix, std::max(ta, ta/ma), std::max(ta, ta/ma), 1.0f);
1155 else if(ta >= 1 && ta/ma >= 1)
1156 Scale(projectionMatrix, std::max(1.0f/ta, ma/ta), std::max(1.0f/ta, ma/ta), 1.0f);
1161 Perspective(projectionMatrix, 1.0f/TAN_FOV, 1.0f, 0.1f, 100.0f);
1170 const float EyeR = l + std::max(
b/TAN_FOV, h/TAN_FOV);
1193 if (mesh_transform_parity) parity = !parity;
1201 RenderMeshImpl(projectionMatrix, modelviewMatrix, instance, dwModClr,
dwBlitMode, dwPlayerColor,
pFoW, clipRect, outRect, parity);
1205 glDepthMask(GL_TRUE);
1206 glDisable(GL_DEPTH_TEST);
1207 glDisable(GL_CULL_FACE);
1208 glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE);
1211 glClear(GL_DEPTH_BUFFER_BIT);
@ C4SSU_AmbientBrightness
@ C4SSU_MaterialShininess
#define VERTEX_OFFSET(field)
C4GraphicsResource GraphicsResource
bool Log(const char *szMessage)
#define C4GFXBLIT_WIREFRAME
#define C4GFXBLIT_ADDITIVE
StdStrBuf FormatString(const char *szFmt,...)
void Rotate(MatrixType &mat, float angle, float x, float y, float z)
void Perspective(MatrixType &mat, float cot_fovy2, float aspect, float nearVal, float farVal)
void Scale(MatrixType &mat, float sx, float sy, float sz)
void Translate(MatrixType &mat, float dx, float dy, float dz)
const StdMeshMatrix * MeshTransform
C4Rect GetClipRect() const
C4Rect GetOutRect() const
C4ScriptUniform scriptUniform
void GetFragTransform(const struct FLOAT_RECT &vpRect, const C4Rect &clipRect, const C4Rect &outRect, float ambientTransform[6]) const
double GetBrightness() const
GLuint getSurfaceName() const
const C4FoW * getFoW() const
const FLOAT_RECT & getViewportRegion() const
void GetFragTransform(const C4Rect &clipRect, const C4Rect &outRect, float lightTransform[6]) const
bool LoadEntryString(const char *szEntryName, StdStrBuf *rBuf)
void SetUniform1f(int iUniform, float gX) const
void SetUniformMatrix4x4(int iUniform, const StdMeshMatrix &matrix)
GLint AllocTexUnit(int iUniform)
void SetUniformMatrix4x4fv(int iUniform, int iLength, const float *pVals) const
void SetUniform2f(int iUniform, float gX, float gY) const
void SetUniform4fv(int iUniform, int iLength, const float *pVals) const
void SetUniform2fv(int iUniform, int iLength, const float *pVals) const
void SetUniform3fv(int iUniform, int iLength, const float *pVals) const
void SetUniformMatrix2x3fv(int iUniform, int iLength, const float *pVals) const
void SetUniform1i(int iUniform, int iX) const
void SetUniformMatrix3x3Transpose(int iUniform, const StdMeshMatrix &matrix)
GLint GetAttribute(int iAttribute) const
bool HaveUniform(int iUniform) const
GLint GetUniform(int iUniform) const
void PerformMesh(StdMeshInstance &instance, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform *pTransform) override
StdProjectionMatrix ProjectionMatrix
bool PrepareMaterial(StdMeshMatManager &mat_manager, StdMeshMaterialLoader &loader, StdMeshMaterial &mat) override
bool GetVAO(unsigned int vaoid, GLuint &vao)
struct CStdGL::@10 Workarounds
size_t GetNumSubMeshes() const
float GetBoundingRadius() const
const StdMeshBox & GetBoundingBox() const
Denumerator * ChildDenumerator
const StdMeshMatrix & GetFinalTransformation() const
float GetCompletion() const
unsigned int GetVAOID() const
size_t GetBoneCount() const
AttachedMeshIter AttachedMeshesBegin() const
const StdSubMeshInstance & GetSubMeshOrdered(size_t i) const
const StdMesh & GetMesh() const
AttachedMeshIter AttachedMeshesEnd() const
const std::vector< StdMeshVertex > & GetSharedVertices() const
AttachedMeshList::const_iterator AttachedMeshIter
const StdMeshMatrix & GetBoneTransform(size_t i) const
const StdMeshMaterialProgram * AddProgram(const char *name, StdMeshMaterialLoader &loader, const StdMeshMaterialPass::ShaderInstance &fragment_shader, const StdMeshMaterialPass::ShaderInstance &vertex_shader, const StdMeshMaterialPass::ShaderInstance &geometry_shader)
const StdMeshMaterialShader * AddShader(const char *filename, const char *name, const char *language, StdMeshMaterialShaderType type, const char *text, uint32_t load_flags)
std::vector< StdMeshMaterialTechnique > Techniques
const StdMeshMaterialShader * Shader
DepthFunctionType AlphaRejectionFunction
SceneBlendType SceneBlendFactors[2]
std::shared_ptr< ProgramInstance > Program
CullHardwareType CullHardware
StdMeshMaterialShaderParameters Parameters
ShaderInstance GeometryShader
ShaderInstance FragmentShader
std::vector< StdMeshMaterialTextureUnit > TextureUnits
ShaderInstance VertexShader
float AlphaRejectionValue
const float * GetMatrix() const
const float * GetFloatv() const
StdMeshMaterialShaderParameter & AddParameter(const char *name, StdMeshMaterialShaderParameter::Type type)
std::vector< StdMeshMaterialPass > Passes
float ColorOpManualColor2[3]
BlendOpSourceType ColorOpSources[2]
float AlphaOpManualFactor
float AlphaOpManualAlpha1
const C4TexRef & GetTexture(unsigned int i) const
float ColorOpManualFactor
float AlphaOpManualAlpha2
size_t GetNumTextures() const
TexAddressModeType TexAddressMode
float ColorOpManualColor1[3]
FilteringType Filtering[3]
BlendOpSourceType AlphaOpSources[2]
std::vector< Transformation > Transformations
bool HasTexCoordAnimation() const
static StdMeshMatrix Identity()
static StdMeshMatrix Inverse(const StdMeshMatrix &mat)
static StdMeshMatrix LookAt(const StdMeshVector &eye, const StdMeshVector ¢er, const StdMeshVector &up)
static StdMeshMatrix Scale(float sx, float sy, float sz)
float Determinant() const
static StdProjectionMatrix Identity()
const char * getData() const
size_t GetOffsetInVBO() const
size_t GetOffsetInIBO() const
const std::vector< Vertex > & GetVertices() const
double GetTexturePosition(size_t pass, size_t texunit) const
size_t GetNumFaces() const
const StdSubMesh & GetSubMesh() const
const StdMeshMaterial & GetMaterial() const
unsigned int GetTexturePhase(size_t pass, size_t texunit) const
void process_bytes(void const *buffer, std::size_t byte_count)
void get_digest(digest_type digest)
static StdMeshVector Translate(float dx, float dy, float dz)
uint16_t bone_index[MaxBoneWeightCount]
static const size_t MaxBoneWeightCount
float bone_weight[MaxBoneWeightCount]