misc...
	* texbro: disable alpha transparency by def; isn't good in half of cases
	* find/replace: tooltip helper note about search mode
	* Entity: arrowheads, showing direction of connection-lines in addition to color-code; New algorithm: are visible in all orthogonal projections
	* tweak: do not render 'misc_model' & 'light' entity names
	* filters: patches: +filter ones with surfaceparm playerclip
	* translucent filter also works for shaders with qer_alphafunc
	* filter areaportal, if single face matches (allows case with other faces, using 'skip')
	* filter translucent, if single face matches
	* filter liquids by surfaceparm {water, lava, slime} in addition to textures/liquids path
This commit is contained in:
Garux
2017-08-01 14:28:28 +03:00
parent dce6730b39
commit a62c7302d3
10 changed files with 81 additions and 27 deletions

View File

@@ -1145,7 +1145,7 @@ void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& l
}
void renderWireframe( Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected ) const {
renderSolid( renderer, volume, localToWorld, selected );
if ( g_showNames ) {
if ( g_showNames && !string_equal( m_named.name(), "light" ) ) {
renderer.addRenderable( m_renderName, localToWorld );
}
}

View File

@@ -199,7 +199,7 @@ void renderSolid( Renderer& renderer, const VolumeTest& volume, const Matrix4& l
}
void renderWireframe( Renderer& renderer, const VolumeTest& volume, const Matrix4& localToWorld, bool selected ) const {
renderSolid( renderer, volume, localToWorld, selected );
if ( g_showNames ) {
if ( g_showNames && !string_equal( m_named.name(), "misc_model" ) ) {
renderer.addRenderable( m_renderName, localToWorld );
}
}

View File

@@ -184,9 +184,57 @@ TargetLinesPushBack( RenderablePointVector& targetLines, const Vector3& worldPos
m_targetLines( targetLines ), m_worldPosition( worldPosition ), m_volume( volume ){
}
void operator()( const Vector3& worldPosition ) const {
if ( m_volume.TestLine( segment_for_startend( m_worldPosition, worldPosition ) ) ) {
Vector3 dir( worldPosition - m_worldPosition );//end - start
double len = vector3_length( dir );
if ( len != 0 && m_volume.TestLine( segment_for_startend( m_worldPosition, worldPosition ) ) ) {
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( m_worldPosition ) ) );
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( worldPosition ) ) );
Vector3 mid( ( worldPosition + m_worldPosition ) * 0.5f );
//vector3_normalise( dir );
dir /= len;
Vector3 hack( 0.57735, 0.57735, 0.57735 );
int maxI = 0;
float max = 0;
for ( int i = 0; i < 3 ; ++i ){
if ( dir[i] < 0 ){
hack[i] *= -1;
}
if ( fabs( dir[i] ) > max ){
maxI = i;
}
}
hack[maxI] *= -1;
Vector3 ort( vector3_cross( dir, hack ) );
//vector3_normalise( ort );
Vector3 wing1( mid - dir*12 + ort*6 );
Vector3 wing2( wing1 - ort*12 );
if( len <= 512 || len > 768 ){
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( mid ) ) );
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing1 ) ) );
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( mid ) ) );
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing2 ) ) );
}
if( len > 512 ){
Vector3 wing1_delta( mid - wing1 );
Vector3 wing2_delta( mid - wing2 );
Vector3 point( m_worldPosition + dir*256 );
wing1 = point - wing1_delta;
wing2 = point - wing2_delta;
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( point ) ) );
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing1 ) ) );
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( point ) ) );
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing2 ) ) );
point = worldPosition - dir*256;
wing1 = point - wing1_delta;
wing2 = point - wing2_delta;
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( point ) ) );
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing1 ) ) );
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( point ) ) );
m_targetLines.push_back( PointVertex( reinterpret_cast<const Vertex3f&>( wing2 ) ) );
}
}
}
};
@@ -253,7 +301,7 @@ RenderableTargetingEntity( TargetingEntity& targets )
}
void compile( const VolumeTest& volume, const Vector3& world_position ) const {
m_target_lines.clear();
m_target_lines.reserve( m_targets.size() * 2 );
m_target_lines.reserve( m_targets.size() * 14 );
TargetingEntity_forEach( m_targets, TargetLinesPushBack( m_target_lines, world_position, volume ) );
}
void render( Renderer& renderer, const VolumeTest& volume, const Vector3& world_position ) const {