Merge pull request #1421 from BlackGoku36/master

add renderpath nodes
This commit is contained in:
Lubos Lenco 2019-10-03 18:12:26 +02:00 committed by GitHub
commit cb2592ad54
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 218 additions and 0 deletions

View file

@ -0,0 +1,30 @@
package armory.logicnode;
class RpConfigNode extends LogicNode {
public var property0:String;
public function new(tree:LogicTree) {
super(tree);
}
override function run(from:Int){
var on:Bool = inputs[1].get();
switch (property0) {
case "SSGI":
on ? armory.data.Config.raw.rp_ssgi = true : armory.data.Config.raw.rp_ssgi = false;
case "SSR":
on ? armory.data.Config.raw.rp_ssr = true : armory.data.Config.raw.rp_ssr = false;
case "Bloom":
on ? armory.data.Config.raw.rp_bloom = true : armory.data.Config.raw.rp_bloom = false;
case "GI":
on ? armory.data.Config.raw.rp_gi = true : armory.data.Config.raw.rp_gi = false;
case "Motion Blur":
on ? armory.data.Config.raw.rp_motionblur = true : armory.data.Config.raw.rp_motionblur = false;// armory.renderpath.RenderPathCreator.applyConfig();
}
armory.renderpath.RenderPathCreator.applyConfig();
armory.data.Config.save();
runOutput(0);
}
}

View file

@ -0,0 +1,29 @@
package armory.logicnode;
class RpMSAANode extends LogicNode {
public var property0:String;
public function new(tree:LogicTree) {
super(tree);
}
override function run(from:Int){
switch (property0) {
case "1":
armory.data.Config.raw.window_msaa = 1;
case "2":
armory.data.Config.raw.window_msaa = 2;
case "4":
armory.data.Config.raw.window_msaa = 4;
case "8":
armory.data.Config.raw.window_msaa = 8;
case "16":
armory.data.Config.raw.window_msaa = 16;
}
armory.renderpath.RenderPathCreator.applyConfig();
armory.data.Config.save();
runOutput(0);
}
}

View file

@ -0,0 +1,26 @@
package armory.logicnode;
class RpShadowQualityNode extends LogicNode {
public var property0:String;
public function new(tree:LogicTree) {
super(tree);
}
override function run(from:Int){
switch (property0) {
case "High":
armory.data.Config.raw.rp_shadowmap_cascade = 4096;
case "Medium":
armory.data.Config.raw.rp_shadowmap_cascade = 2048;
case "Low":
armory.data.Config.raw.rp_shadowmap_cascade = 1024;
}
armory.renderpath.RenderPathCreator.applyConfig();
armory.data.Config.save();
runOutput(0);
}
}

View file

@ -0,0 +1,27 @@
package armory.logicnode;
class RpSuperSampleNode extends LogicNode {
public var property0:String;
public function new(tree:LogicTree) {
super(tree);
}
override function run(from:Int){
switch (property0) {
case "1":
armory.data.Config.raw.rp_supersample = 1;
case "1.5":
armory.data.Config.raw.rp_supersample = 1.5;
case "2":
armory.data.Config.raw.rp_supersample = 2;
case "4":
armory.data.Config.raw.rp_supersample = 4;
}
armory.renderpath.RenderPathCreator.applyConfig();
armory.data.Config.save();
runOutput(0);
}
}

View file

@ -0,0 +1,28 @@
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class RpConfigNode(Node, ArmLogicTreeNode):
'''Configure renderpath node'''
bl_idname = 'LNRpConfigNode'
bl_label = 'Rp Config'
bl_icon = 'CURVE_PATH'
property0: EnumProperty(
items = [('SSGI', 'SSGI', 'SSGI'),
('SSR', 'SSR', 'SSR'),
('Bloom', 'Bloom', 'Bloom'),
('GI', 'GI', 'GI'),
('Motion Blur', 'Motion Blur', 'Motion Blur')
],
name='', default='SSGI')
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.inputs.new('NodeSocketBool', 'On')
self.outputs.new('ArmNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
add_node(RpConfigNode, category='Renderpath')

View file

@ -0,0 +1,27 @@
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class RpMSAANode(Node, ArmLogicTreeNode):
'''Configure multi-sample anti-aliasing node'''
bl_idname = 'LNRpMSAANode'
bl_label = 'Rp MSAA'
bl_icon = 'CURVE_PATH'
property0: EnumProperty(
items = [('1', '1', '1'),
('2', '2', '2'),
('4', '4', '4'),
('8', '8', '8'),
('16', '16', '16')
],
name='', default='1')
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.outputs.new('ArmNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
add_node(RpMSAANode, category='Renderpath')

View file

@ -0,0 +1,25 @@
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class RpShadowQualityNode(Node, ArmLogicTreeNode):
'''Configure shadow quality node'''
bl_idname = 'LNRpShadowQualityNode'
bl_label = 'Rp Shadow Quality'
bl_icon = 'CURVE_PATH'
property0: EnumProperty(
items = [('High', 'High', 'High'),
('Medium', 'Medium', 'Medium'),
('Low', 'Low', 'Low')
],
name='', default='Medium')
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.outputs.new('ArmNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
add_node(RpShadowQualityNode, category='Renderpath')

View file

@ -0,0 +1,26 @@
import bpy
from bpy.props import *
from bpy.types import Node, NodeSocket
from arm.logicnode.arm_nodes import *
class RpSuperSampleNode(Node, ArmLogicTreeNode):
'''Configure super sampling node'''
bl_idname = 'LNRpSuperSampleNode'
bl_label = 'Rp Super-sampling'
bl_icon = 'CURVE_PATH'
property0: EnumProperty(
items = [('1', '1', '1'),
('1.5', '1.5', '1.5'),
('2', '2', '2'),
('4', '4', '4')
],
name='', default='1')
def init(self, context):
self.inputs.new('ArmNodeSocketAction', 'In')
self.outputs.new('ArmNodeSocketAction', 'Out')
def draw_buttons(self, context, layout):
layout.prop(self, 'property0')
add_node(RpSuperSampleNode, category='Renderpath')