• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[General] Increase in-game max zoom out distance (remove the black fog from top of screen)

Status
Not open for further replies.
Level 3
Joined
Mar 18, 2020
Messages
20
Is there a way to remove the black fog that overtakes the screen from the top down when the in-game camera's distance is set further than 4000? I'd like the player to be able to zoom out further

I found this post (How do you remove the black layer when you zoom out?) which says that it can be changed by increasing the Far-Z value to an arbitrarily high number, but I tested this and it doesn't seem to work.

Thanks
 
Change Far Z to 10000 (it's the max number), see if that helps.

There is also a trigger for it, under Camera category.
- Camera - Change Camera Far Z to 10000

(I don't exactly remember the exact trigger but it's like that).

I am not sure if you can remove it but as far as I know you can't. What it does is thay every object behind that black fog will no longer be rendered/visible in the game to save performance, it's how the game's optimized since the game doesn't have/support Far LODs (render only low quality version of each objects when at far distance) like the modern games, basically it's part of the game - your only choice is to move it further away from your view.
 
Last edited:
Level 18
Joined
Jan 1, 2018
Messages
728
  • Camera - Set Player 1 (Red)'s camera Far Z to 99999.00 over 0.00 seconds
  • Environment - Set fog to style Linear, z-start 99999.00, z-end 99999.00, density 0.00 and color (100.00%, 100.00%, 100.00%)
 
Level 12
Joined
Jan 30, 2020
Messages
875
  • Camera - Set Player 1 (Red)'s camera Far Z to 99999.00 over 0.00 seconds
  • Environment - Set fog to style Linear, z-start 99999.00, z-end 99999.00, density 0.00 and color (100.00%, 100.00%, 100.00%)

Yes, I use the related common.j natives in my map when using a vertical slider to set the camera distance!

Some things I have noticed :
- as Strydhaizer mentioned, the maximum farZ is 10 000
- maximum camera distance (CAMERA_FIELD_TARGET_DISTANCE) is also 10 000
- you need to apply these settings everytime you change the camera distance, because if a player uses the mouse wheel to change the camera angle, it will reset that fog settings
- for these reasons, in my vertical slider distance settings, i set the maximum distance to 7900 and the farZ value to (distance + 2 100). Any value beyond is overkill and with values below i can still see traces of this terrainfog in some areas of the map.

EDIT :
Here is my slider if you want to test it :
JASS:
function UpdateCamera takes nothing returns boolean
    local real distance=BlzGetTriggerFrameValue()
    local real farZ=distance+2100

    if (GetTriggerPlayer()==GetLocalPlayer()) then
        call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, distance, 0)
        call SetCameraField(CAMERA_FIELD_FARZ, farZ, 0 )
        call SetTerrainFogEx(0, farZ, farZ, 0, 1.00, 1.00, 1.00)
    endif
    return false
endfunction


function Camera_Zoom_Slider takes nothing returns nothing
    local trigger cameraZoomSlider=CreateTrigger()
    local framehandle verticalSlider=BlzCreateFrameByType("SLIDER", "distance", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "QuestMainListScrollBar", 0)
    local framehandle sliderToolTip=BlzCreateFrameByType("TEXT", "SliderTitle", BlzGetOriginFrame(ORIGIN_FRAME_GAME_UI, 0), "", 0)
    local integer color= BlzConvertColor(255, 255, 255, 0)

    // Set parametees for the Slider...
    // call BlzFrameSetVertexColor(verticalSlider, color) // does not work
    call BlzFrameSetSize(verticalSlider, 0.018, 0.076)
    call BlzFrameSetAbsPoint(verticalSlider, FRAMEPOINT_BOTTOMLEFT, 0.20, 0.027)
    call BlzFrameSetMinMaxValue(verticalSlider, 100, 7900)
    call BlzFrameSetValue(verticalSlider, 2600)
    call BlzFrameSetStepSize(verticalSlider, 50)

    // ... and for the sliderToolTip
    call BlzFrameSetTextColor(sliderToolTip, color)
    call BlzFrameSetText(sliderToolTip, "USE THIS SLIDER TO CONTROL THE CAMERA ZOOM")
    call BlzFrameSetScale(sliderToolTip, 1.60)
    call BlzFrameSetAbsPoint(sliderToolTip, FRAMEPOINT_BOTTOMLEFT, 0.22, 0.16)
    call BlzFrameSetTooltip(verticalSlider, sliderToolTip)

    // Set Initial camera distance for all players
    call SetCameraField(CAMERA_FIELD_TARGET_DISTANCE, 2600, 0)
 
    // Add event and actions in conditions to trigger for the Slider
    call BlzTriggerRegisterFrameEvent(cameraZoomSlider, verticalSlider, FRAMEEVENT_SLIDER_VALUE_CHANGED)
    call TriggerAddCondition(cameraZoomSlider, function UpdateCamera)

    // nulling
    set verticalSlider=null
    set sliderToolTip=null
    set cameraZoomSlider=null
endfunction

Note that I call this function in my map initialization custom trigger, so if you are not using Jass but GUI, just add it to your map's Custom script code (when your click on your map name on the top of the trigger editor, and then call the function in your map initialization trigger :

  • Custom script: call Camera_Zoom_Slider()
NOTES :
- all credits for the means to create a vertical slider are due to @Tasyen
- the slider should position on the left of the portrait - I use a custom interface so I am not 100% the position will be accurate with the standard interface
 
Last edited:
Status
Not open for further replies.
Top