Minimap creation - Page 3

Minimap creation

Discuss maps & map creation - from concept to execution to the ever elusive release.

Moderator: Moderators

User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Minimap creation

Post by qray »

@ aeonios:
aeonios wrote:Hm, BA produced slightly better results, but the camera was zoomed all the way in. It also ended up taking 10 screenshots, only one of them sort-of decent. How do you control the fov and such? I haven't been able to find any settings for it. :|
FOV is set in line 23:

Code: Select all

    local fov = 11.25 -- fov angle in degree
Everything else is calculated from this (and map size, but this is read from the file automatically). Normal camera fov seems to be 45. Below around 10 shadows should be disabled (they tend to give artefacts).
In line 72-74 there is commented debug output code:

Code: Select all

        --for index,value in pairs(Spring.GetCameraState()) do
        --    Spring.Echo("Camera State camStateLocal[\"" ..index .."\"]=" .. value)
        --end
Might help to uncomment this (don't know why, but sometimes it ran than more stable for me with this output on).

@ gajop
Thanks a lot! :-) Will be a big help since I tend to learn better from examples.
gajop wrote:It's also inefficient
Efficiency won't be a big problem / major goal at the beginning, since it's only used once to create the image and doesn't run in a real game.
Currently in chapter 6 of the book while framebuffer comes in chapter 10. RL, working on half finished maps and actually playing every now and then does not help to speed up my progress :wink:
aeonios
Posts: 202
Joined: 03 Feb 2015, 14:27

Re: Minimap creation

Post by aeonios »

Oi, well for the moment: https://www.dropbox.com/s/x2gaedku2dsn0 ... 1.sd7?dl=0

Seems like it'd be a pain to get it working atm, although I look forward to an improved version.
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Minimap creation

Post by qray »

aeonios wrote:Oi, well for the moment: https://www.dropbox.com/s/x2gaedku2dsn0 ... 1.sd7?dl=0
Seems like it'd be a pain to get it working atm, although I look forward to an improved version.
Strange that it doesn't work for you :(
Attached an image I took here (fov=3, no height scaling).
Attachments
minimap_Pond_of_Dunes.png
(1.45 MiB) Not downloaded yet
aeonios
Posts: 202
Joined: 03 Feb 2015, 14:27

Re: Minimap creation

Post by aeonios »

Thanks! I'm sure you'll figure it out in time. :P
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Minimap creation

Post by gajop »

Also, why is it you can't use the $minimap texture provided by Spring?
If you did, all you have to do would be:

Code: Select all

        local minimapPath = "minimap.png"
        Spring.Echo("Saving the minimap to " .. minimapPath .. "...")

        if VFS.FileExists(minimapPath, VFS.RAW) then
            Spring.Echo("removing the existing minimap")
            os.remove(minimapPath)
        end

        local texInfo = gl.TextureInfo("$minimap")
        local minimapTexture = gl.CreateTexture(texInfo.xsize, texInfo.ysize, {
            border = false,
            min_filter = GL.LINEAR,
            mag_filter = GL.LINEAR,
            wrap_s = GL.CLAMP_TO_EDGE,
            wrap_t = GL.CLAMP_TO_EDGE,
            fbo = true,
        })

        gl.Texture("$minimap")
        gl.RenderToTexture(minimapTexture,
        function()
            gl.TexRect(-1,-1, 1, 1)
        end)
        gl.Texture(false)

        gl.RenderToTexture(minimapTexture, gl.SaveImage, 0, 0, texInfo.xsize, texInfo.ysize, minimapPath)
        gl.DeleteTexture(minimapTexture)
User avatar
qray
Posts: 377
Joined: 02 Feb 2009, 18:49

Re: Minimap creation

Post by qray »

Sorry for late reply. Didn't find too much time (and energy) for spring in the last weeks :-(
I am not sure, if taking minimap fully works for what I had in mind (=to get a shinier minimap image). Will have to try... :-)
Post Reply

Return to “Map Creation”