mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2025-01-25 10:51:36 +00:00
- Fixed "jumping" texcoords when switching to a shader with different size
- (Todo) Toolbar: add button for refresh-models. (Shaderman) - Aniso fix (Shaderman) - Translucency fix (Shaderman) git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@136 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
5e882b2713
commit
8235a81ac1
12 changed files with 57 additions and 3 deletions
7
CHANGES
7
CHANGES
|
@ -1,6 +1,13 @@
|
||||||
This is the changelog for developers, != changelog for the end user
|
This is the changelog for developers, != changelog for the end user
|
||||||
that we distribute with the binaries. (see changelog)
|
that we distribute with the binaries. (see changelog)
|
||||||
|
|
||||||
|
17/01/2007
|
||||||
|
namespace
|
||||||
|
- Fixed "jumping" texcoords when switching to a shader with different size
|
||||||
|
- (Todo) Toolbar: add button for refresh-models. (Shaderman)
|
||||||
|
- Aniso fix (Shaderman)
|
||||||
|
- Translucency fix (Shaderman)
|
||||||
|
|
||||||
05/01/2007
|
05/01/2007
|
||||||
namespace
|
namespace
|
||||||
- UFO:Alien Invasion Plugin (mattn2)
|
- UFO:Alien Invasion Plugin (mattn2)
|
||||||
|
|
1
TODO
1
TODO
|
@ -49,7 +49,6 @@ Mouse: support 2-button mouse.
|
||||||
Grid: background colour should be different when the smallest grid is invisible due to being zoomed out.
|
Grid: background colour should be different when the smallest grid is invisible due to being zoomed out.
|
||||||
Brush: option to disable dots on selected faces when not in face mode.
|
Brush: option to disable dots on selected faces when not in face mode.
|
||||||
Entity: draw direction arrow for func_door and func_button angle.
|
Entity: draw direction arrow for func_door and func_button angle.
|
||||||
Toolbar: add button for refresh-models.
|
|
||||||
Build Menu: support for editing variables.
|
Build Menu: support for editing variables.
|
||||||
Shaders: handle doom3 materials with multiple bumpmaps stage - use first stage, ignore later stages.
|
Shaders: handle doom3 materials with multiple bumpmaps stage - use first stage, ignore later stages.
|
||||||
Brush: warn when a brush is dragged into a configuration with <0 volume
|
Brush: warn when a brush is dragged into a configuration with <0 volume
|
||||||
|
|
|
@ -1347,6 +1347,8 @@ typedef void GLvoid;
|
||||||
#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
|
#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
|
||||||
#define GL_SECONDARY_COLOR_ARRAY 0x845E
|
#define GL_SECONDARY_COLOR_ARRAY 0x845E
|
||||||
#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
|
#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
|
||||||
|
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
|
||||||
|
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
|
||||||
#define GL_TEXTURE_FILTER_CONTROL 0x8500
|
#define GL_TEXTURE_FILTER_CONTROL 0x8500
|
||||||
#define GL_TEXTURE_LOD_BIAS 0x8501
|
#define GL_TEXTURE_LOD_BIAS 0x8501
|
||||||
#define GL_INCR_WRAP 0x8507
|
#define GL_INCR_WRAP 0x8507
|
||||||
|
|
|
@ -1281,6 +1281,7 @@ public:
|
||||||
Brush_textureChanged();
|
Brush_textureChanged();
|
||||||
m_observer->shaderChanged();
|
m_observer->shaderChanged();
|
||||||
updateFiltered();
|
updateFiltered();
|
||||||
|
planeChanged();
|
||||||
SceneChangeNotify();
|
SceneChangeNotify();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1906,6 +1907,7 @@ public:
|
||||||
void shaderChanged()
|
void shaderChanged()
|
||||||
{
|
{
|
||||||
updateFiltered();
|
updateFiltered();
|
||||||
|
planeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void evaluateBRep() const
|
void evaluateBRep() const
|
||||||
|
|
|
@ -24,6 +24,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
#include "math/vector.h"
|
#include "math/vector.h"
|
||||||
#include "itexdef.h"
|
#include "itexdef.h"
|
||||||
|
#include "debugging/debugging.h"
|
||||||
// Timo
|
// Timo
|
||||||
// new brush primitive texdef
|
// new brush primitive texdef
|
||||||
struct brushprimit_texdef_t
|
struct brushprimit_texdef_t
|
||||||
|
@ -51,6 +52,8 @@ struct brushprimit_texdef_t
|
||||||
void addScale(std::size_t width, std::size_t height)
|
void addScale(std::size_t width, std::size_t height)
|
||||||
{
|
{
|
||||||
#if 1
|
#if 1
|
||||||
|
ASSERT_MESSAGE(width > 0, "shader-width is 0");
|
||||||
|
ASSERT_MESSAGE(height > 0, "shader-height is 0");
|
||||||
coords[0][0] /= width;
|
coords[0][0] /= width;
|
||||||
coords[0][1] /= width;
|
coords[0][1] /= width;
|
||||||
coords[0][2] /= width;
|
coords[0][2] /= width;
|
||||||
|
|
|
@ -2528,6 +2528,10 @@ GtkToolbar* create_main_toolbar(MainFrame::EViewStyle style)
|
||||||
// TODO: call light inspector
|
// TODO: call light inspector
|
||||||
//GtkButton* g_view_lightinspector_button = toolbar_append_button(toolbar, "Light Inspector", "lightinspector.bmp", "ToggleLightInspector");
|
//GtkButton* g_view_lightinspector_button = toolbar_append_button(toolbar, "Light Inspector", "lightinspector.bmp", "ToggleLightInspector");
|
||||||
|
|
||||||
|
gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
|
||||||
|
GtkButton* g_refresh_models_button = toolbar_append_button(toolbar, "Refresh Models", "refresh_models.bmp", "RefreshReferences");
|
||||||
|
|
||||||
|
|
||||||
// disable the console and texture button in the regular layouts
|
// disable the console and texture button in the regular layouts
|
||||||
if(style == MainFrame::eRegular || style == MainFrame::eRegularLeft)
|
if(style == MainFrame::eRegular || style == MainFrame::eRegularLeft)
|
||||||
{
|
{
|
||||||
|
|
|
@ -700,6 +700,13 @@ inline void extension_not_implemented(const char* extension)
|
||||||
globalErrorStream() << "WARNING: OpenGL driver reports support for " << extension << " but does not implement it\n";
|
globalErrorStream() << "WARNING: OpenGL driver reports support for " << extension << " but does not implement it\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float g_maxTextureAnisotropy;
|
||||||
|
|
||||||
|
float QGL_maxTextureAnisotropy()
|
||||||
|
{
|
||||||
|
return g_maxTextureAnisotropy;
|
||||||
|
}
|
||||||
|
|
||||||
void QGL_sharedContextCreated(OpenGLBinding& table)
|
void QGL_sharedContextCreated(OpenGLBinding& table)
|
||||||
{
|
{
|
||||||
QGL_InitVersion();
|
QGL_InitVersion();
|
||||||
|
@ -1583,6 +1590,16 @@ void QGL_sharedContextCreated(OpenGLBinding& table)
|
||||||
|
|
||||||
table.support_ARB_fragment_shader = QGL_ExtensionSupported("GL_ARB_fragment_shader");
|
table.support_ARB_fragment_shader = QGL_ExtensionSupported("GL_ARB_fragment_shader");
|
||||||
table.support_ARB_shading_language_100 = QGL_ExtensionSupported("GL_ARB_shading_language_100");
|
table.support_ARB_shading_language_100 = QGL_ExtensionSupported("GL_ARB_shading_language_100");
|
||||||
|
|
||||||
|
if(QGL_ExtensionSupported("GL_EXT_texture_filter_anisotropic"))
|
||||||
|
{
|
||||||
|
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &g_maxTextureAnisotropy);
|
||||||
|
globalOutputStream() << "Anisotropic filtering possible (max " << g_maxTextureAnisotropy << "x)\n";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
globalOutputStream() << "No Anisotropic filtering available\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QGL_sharedContextDestroyed(OpenGLBinding& table)
|
void QGL_sharedContextDestroyed(OpenGLBinding& table)
|
||||||
|
|
|
@ -26,4 +26,8 @@ struct OpenGLBinding;
|
||||||
void QGL_sharedContextCreated(OpenGLBinding& table);
|
void QGL_sharedContextCreated(OpenGLBinding& table);
|
||||||
void QGL_sharedContextDestroyed(OpenGLBinding& table);
|
void QGL_sharedContextDestroyed(OpenGLBinding& table);
|
||||||
|
|
||||||
|
bool QGL_ExtensionSupported(const char* extension);
|
||||||
|
|
||||||
|
float QGL_maxTextureAnisotropy();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2387,7 +2387,11 @@ void OpenGLShader::construct(const char* name)
|
||||||
state.m_colour[2] = 0;
|
state.m_colour[2] = 0;
|
||||||
state.m_colour[3] = 0.3f;
|
state.m_colour[3] = 0.3f;
|
||||||
state.m_state = RENDER_FILL|RENDER_DEPTHTEST|RENDER_CULLFACE|RENDER_BLEND|RENDER_COLOURWRITE|RENDER_DEPTHWRITE;
|
state.m_state = RENDER_FILL|RENDER_DEPTHTEST|RENDER_CULLFACE|RENDER_BLEND|RENDER_COLOURWRITE|RENDER_DEPTHWRITE;
|
||||||
state.m_sort = OpenGLState::eSortHighlight;
|
|
||||||
|
// The bug "Selecting translucent brushes, such as clip, cause them to disappear leaving
|
||||||
|
// only the red selection box." seems to be fixed by removing the next line.
|
||||||
|
|
||||||
|
// state.m_sort = OpenGLState::eSortHighlight;
|
||||||
state.m_depthfunc = GL_LEQUAL;
|
state.m_depthfunc = GL_LEQUAL;
|
||||||
}
|
}
|
||||||
else if(string_equal(name+1, "CAM_OVERLAY"))
|
else if(string_equal(name+1, "CAM_OVERLAY"))
|
||||||
|
|
|
@ -49,6 +49,7 @@ enum ETexturesMode
|
||||||
eTextures_LINEAR = 3,
|
eTextures_LINEAR = 3,
|
||||||
eTextures_LINEAR_MIPMAP_NEAREST = 4,
|
eTextures_LINEAR_MIPMAP_NEAREST = 4,
|
||||||
eTextures_LINEAR_MIPMAP_LINEAR = 5,
|
eTextures_LINEAR_MIPMAP_LINEAR = 5,
|
||||||
|
eTextures_MAX_ANISOTROPY = 6,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum TextureCompressionFormat
|
enum TextureCompressionFormat
|
||||||
|
@ -90,6 +91,8 @@ texture_globals_t g_texture_globals(GL_RGBA);
|
||||||
|
|
||||||
void SetTexParameters(ETexturesMode mode)
|
void SetTexParameters(ETexturesMode mode)
|
||||||
{
|
{
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 1.0f);
|
||||||
|
|
||||||
switch (mode)
|
switch (mode)
|
||||||
{
|
{
|
||||||
case eTextures_NEAREST:
|
case eTextures_NEAREST:
|
||||||
|
@ -116,6 +119,9 @@ void SetTexParameters(ETexturesMode mode)
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR );
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
|
||||||
break;
|
break;
|
||||||
|
case eTextures_MAX_ANISOTROPY:
|
||||||
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, QGL_maxTextureAnisotropy());
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
globalOutputStream() << "invalid texture mode\n";
|
globalOutputStream() << "invalid texture mode\n";
|
||||||
}
|
}
|
||||||
|
@ -703,6 +709,8 @@ void TextureModeImport(ETexturesMode& self, int value)
|
||||||
case 5:
|
case 5:
|
||||||
Textures_SetMode(eTextures_LINEAR_MIPMAP_LINEAR);
|
Textures_SetMode(eTextures_LINEAR_MIPMAP_LINEAR);
|
||||||
break;
|
break;
|
||||||
|
case 6:
|
||||||
|
Textures_SetMode(eTextures_MAX_ANISOTROPY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
typedef ReferenceCaller1<ETexturesMode, int, TextureModeImport> TextureModeImportCaller;
|
typedef ReferenceCaller1<ETexturesMode, int, TextureModeImport> TextureModeImportCaller;
|
||||||
|
@ -729,6 +737,9 @@ void TextureModeExport(ETexturesMode& self, const IntImportCallback& importer)
|
||||||
case eTextures_LINEAR_MIPMAP_LINEAR:
|
case eTextures_LINEAR_MIPMAP_LINEAR:
|
||||||
importer(5);
|
importer(5);
|
||||||
break;
|
break;
|
||||||
|
case eTextures_MAX_ANISOTROPY:
|
||||||
|
importer(6);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
importer(4);
|
importer(4);
|
||||||
}
|
}
|
||||||
|
@ -755,7 +766,7 @@ void Textures_constructPreferences(PreferencesPage& page)
|
||||||
FloatExportCallback(FloatExportCaller(g_texture_globals.fGamma))
|
FloatExportCallback(FloatExportCaller(g_texture_globals.fGamma))
|
||||||
);
|
);
|
||||||
{
|
{
|
||||||
const char* texture_mode[] = { "Nearest", "Nearest Mipmap", "Linear", "Bilinear", "Bilinear Mipmap", "Trilinear" };
|
const char* texture_mode[] = { "Nearest", "Nearest Mipmap", "Linear", "Bilinear", "Bilinear Mipmap", "Trilinear", "Anisotropy" };
|
||||||
page.appendCombo(
|
page.appendCombo(
|
||||||
"Texture Render Mode",
|
"Texture Render Mode",
|
||||||
STRING_ARRAY_RANGE(texture_mode),
|
STRING_ARRAY_RANGE(texture_mode),
|
||||||
|
|
BIN
setup/data/tools/bitmaps/refresh_models.bmp
Normal file
BIN
setup/data/tools/bitmaps/refresh_models.bmp
Normal file
Binary file not shown.
After Width: | Height: | Size: 776 B |
|
@ -34,6 +34,7 @@
|
||||||
<file name="patch_weld.bmp"/>
|
<file name="patch_weld.bmp"/>
|
||||||
<file name="patch_wireframe.bmp"/>
|
<file name="patch_wireframe.bmp"/>
|
||||||
<file name="popup_selection.bmp"/>
|
<file name="popup_selection.bmp"/>
|
||||||
|
<file name="refresh_models.bmp"/>
|
||||||
<file name="scalelockx.bmp"/>
|
<file name="scalelockx.bmp"/>
|
||||||
<file name="scalelocky.bmp"/>
|
<file name="scalelocky.bmp"/>
|
||||||
<file name="scalelockz.bmp"/>
|
<file name="scalelockz.bmp"/>
|
||||||
|
|
Loading…
Reference in a new issue