mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
maintenance: minor code tweaks
This commit is contained in:
@@ -43,7 +43,8 @@ void render_task::run() {
|
||||
PyInt_AsLong( outputwidth ), PyInt_AsLong( outputheight ), 0,
|
||||
GL_RGB, GL_UNSIGNED_BYTE, reinterpret_cast<GLubyte const *>( PyString_AsString( output ) ) );
|
||||
// setup texture parameters
|
||||
if( GL_EXT_texture_filter_anisotropic ) {
|
||||
if( ( Global.AnisotropicFiltering >= 0 )
|
||||
&& ( GL_EXT_texture_filter_anisotropic != 0 ) ) {
|
||||
// anisotropic filtering
|
||||
::glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, Global.AnisotropicFiltering );
|
||||
}
|
||||
|
||||
@@ -433,10 +433,12 @@ bool TSegment::RenderLoft( gfx::vertex_array &Output, Math3D::vector3 const &Ori
|
||||
m2 = 1.f;
|
||||
jmm2 = 0.f;
|
||||
}
|
||||
|
||||
/*
|
||||
while( tv1 < 0.0 ) {
|
||||
tv1 += 1.0;
|
||||
}
|
||||
*/
|
||||
tv1 = clamp_circular( tv1, 1.0f );
|
||||
tv2 = tv1 - step / texturelength; // mapowanie na końcu segmentu
|
||||
|
||||
t = fTsBuffer[ i ]; // szybsze od GetTFromS(s);
|
||||
|
||||
@@ -1020,7 +1020,8 @@ opengl_texture::set_filtering() const {
|
||||
::glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||
::glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
|
||||
|
||||
if( GL_EXT_texture_filter_anisotropic ) {
|
||||
if( ( Global.AnisotropicFiltering >= 0 )
|
||||
&& ( GL_EXT_texture_filter_anisotropic != 0 ) ) {
|
||||
// anisotropic filtering
|
||||
::glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, Global.AnisotropicFiltering );
|
||||
}
|
||||
|
||||
@@ -150,8 +150,12 @@ void calculate_tangent(vertex_array &vertices, int type)
|
||||
const glm::vec3 &t = tan[a];
|
||||
const glm::vec3 &t2 = tan[vertex_count + a];
|
||||
|
||||
vertices[a].tangent = glm::vec4(glm::normalize((t - n * glm::dot(n, t))),
|
||||
(glm::dot(glm::cross(n, t), t2) < 0.0F) ? -1.0F : 1.0F);
|
||||
vertices[a].tangent =
|
||||
glm::vec4(
|
||||
glm::normalize((t - n * glm::dot(n, t))),
|
||||
(glm::dot(glm::cross(n, t), t2) < 0.0F) ?
|
||||
-1.0F :
|
||||
1.0F);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user