Streaming game development: https://www.twitch.tv/stabyourself Image

[Help needed] More shaders at once.

Mods, guides how to use and install mods go right in here.
Villager103
User avatar
Posts: 604
Joined: 31 Jan 2013, 14:50
Reputation: 53
Contact:

Post » 29 Aug 2015, 18:35

Hello! I was installing a couple shaders, but I would like to use more than 2 at once. Is there any simple way, through modding, to add more shader slots? Thanks!

I LÖVE LUA
User avatar
Posts: 139
Joined: 12 Aug 2013, 13:19
Reputation: 18
Contact:

Post » 31 Aug 2015, 15:17

Villager103 wrote:Hello! I was installing a couple shaders, but I would like to use more than 2 at once. Is there any simple way, through modding, to add more shader slots? Thanks!


Okay, here is how to do it :
  • First, search for all entries with currentshaderi in main.lua and add more variables
    Ex (function defaultconfig @ line 1353):

    Code: Select all

    currentshaderi1 = 1
    currentshaderi2 = 1
    -- The part you add
    currentshaderi3 = 1
    currentshaderi4 = 1

  • Then, in menu.lua, just duplicate this piece (from function menu_draw @ line 866) :

    Code: Select all

    if optionsselection == 3 then
       love.graphics.setColor(255, 255, 255, 255)
    else
       love.graphics.setColor(100, 100, 100, 255)
    end
             
    properprint("shader1:", 30*scale, 55*scale)
    if shaderssupported == false then
       properprint("unsupported", (180-string.len("unsupported")*8)*scale, 55*scale)
    else
       properprint(string.lower(shaderlist[currentshaderi1]), (180-string.len(shaderlist[currentshaderi1])*8)*scale, 55*scale)
    end


    (replace if optionsselection == 3 then, properprint("shader1:" [...] and [...] shaderlist[currentshaderi1] to fit your need)

  • Still in menu.lua, find currentshaderi1 = currentshaderi1 + 1 and add more of

    Code: Select all

    elseif optionsselection == 3 then
       currentshaderi1 = currentshaderi1 + 1
       if currentshaderi1 > #shaderlist then
          currentshaderi1 = 1
       end
       if shaderlist[currentshaderi1] == "none" then
          shaders:set(1, nil)
       else
          shaders:set(1, shaderlist[currentshaderi1])
       end

    using the same optionsselection value setted in the previous step.

  • Repeat the previous step, but by seeking for currentshaderi1 = currentshaderi1 - 1 instead.


Return to “Modding”

Who is online

Users browsing this forum: No registered users and 2 guests