* add prefs->Build->Region Box Shader (shader to use on the box generated around region)

This commit is contained in:
Garux
2024-12-18 08:22:00 +05:00
parent c7fd44d2c0
commit b3ff10b287
3 changed files with 17 additions and 3 deletions
+1
View File
@@ -1098,6 +1098,7 @@ misc...
* fix: do not modify light intensity on transformations besides light radius transformation
* light radiuses: don't render biggest radius, make them less occluding in 3D
* fix surface inspector updates on patch texturing changes, on UV Tool edits
* add prefs->Build->Region Box Shader (shader to use on the box generated around region)
+11 -2
View File
@@ -463,7 +463,16 @@ void Brush_ConstructPrefab( Brush& brush, EBrushPrefab type, const AABB& bounds,
}
CopiedString g_regionBoxShader;
void ConstructRegionBrushes( scene::Node* brushes[6], const Vector3& region_mins, const Vector3& region_maxs ){
const char *shader = g_regionBoxShader.empty()
? texdef_name_default()
: texdef_name_valid( g_regionBoxShader.c_str() )
? g_regionBoxShader.c_str()
: ( globalWarningStream() << "g_regionBoxShader " << makeQuoted( g_regionBoxShader ) << " !texdef_name_valid()\n"
, texdef_name_default() );
{
// set mins
const Vector3 mins( region_mins - Vector3( 32 ) );
@@ -473,7 +482,7 @@ void ConstructRegionBrushes( scene::Node* brushes[6], const Vector3& region_mins
{
Vector3 maxs( region_maxs + Vector3( 32 ) );
maxs[i] = region_mins[i];
Brush_ConstructCuboid( *Node_getBrush( *brushes[i] ), aabb_for_minmax( mins, maxs ), texdef_name_default(), TextureProjection() );
Brush_ConstructCuboid( *Node_getBrush( *brushes[i] ), aabb_for_minmax( mins, maxs ), shader, TextureProjection() );
}
}
@@ -486,7 +495,7 @@ void ConstructRegionBrushes( scene::Node* brushes[6], const Vector3& region_mins
{
Vector3 mins( region_mins - Vector3( 32 ) );
mins[i] = region_maxs[i];
Brush_ConstructCuboid( *Node_getBrush( *brushes[i + 3] ), aabb_for_minmax( mins, maxs ), texdef_name_default(), TextureProjection() );
Brush_ConstructCuboid( *Node_getBrush( *brushes[i + 3] ), aabb_for_minmax( mins, maxs ), shader, TextureProjection() );
}
}
}
+5 -1
View File
@@ -222,6 +222,8 @@ static DefaultableString g_engineExecutableMP( []()->CopiedString{ return g_pGam
static DefaultableString g_engineArgs( constructEngineArgs<false> );
static DefaultableString g_engineArgsMP( constructEngineArgs<true> );
extern CopiedString g_regionBoxShader;
void Build_constructPreferences( PreferencesPage& page ){
QCheckBox* monitorbsp = page.appendCheckBox( "", "Enable Build Process Monitoring", g_WatchBSP_Enabled );
@@ -242,6 +244,8 @@ void Build_constructPreferences( PreferencesPage& page ){
}
page.appendCheckBox( "", "Dump non Monitored Builds Log", g_WatchBSP0_DumpLog );
page.appendEntry( "Region Box Shader", g_regionBoxShader );
}
void Build_constructPage( PreferenceGroup& group ){
PreferencesPage page( group.createPage( "Build", "Build Preferences" ) );
@@ -267,7 +271,7 @@ void BuildMonitor_Construct(){
GlobalPreferenceSystem().registerPreference( "BuildEngineArgs", g_engineArgs.getImportCaller(), g_engineArgs.getExportCaller() );
GlobalPreferenceSystem().registerPreference( "BuildEngineArgsMP", g_engineArgsMP.getImportCaller(), g_engineArgsMP.getExportCaller() );
GlobalPreferenceSystem().registerPreference( "BuildDumpLog", BoolImportStringCaller( g_WatchBSP0_DumpLog ), BoolExportStringCaller( g_WatchBSP0_DumpLog ) );
GlobalPreferenceSystem().registerPreference( "RegionBoxShader", CopiedStringImportStringCaller( g_regionBoxShader ), CopiedStringExportStringCaller( g_regionBoxShader ) );
Build_registerPreferencesPage();
}