[Help needed] More shaders at once.

Mods, guides how to use and install mods go right in here.
Post Reply
User avatar
Villager103
Posts: 506
Joined: 31 Jan 2013, 14:50
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!

User avatar
I LÖVE LUA
Posts: 222
Joined: 12 Aug 2013, 13:19

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.

Post Reply