Material Editor
  • bricebrice
    junior Member
    Posts: 2
    Joined: Fri Sep 14, 2018 11:54 pm

    Material Editor

    by bricebrice » Sat Sep 15, 2018 11:46 pm

    Hello,

    I work on cinemas and commercials set as a gaffer.
    Yesterday was my first shoot with MADMAPPER to send DMX to 12 ARRI Skypanel :)
    It worked great and it’s pretty reliable on my HP x360 Spectre (2017) and USB C -> Ethernet adaptor to the ENTTEC ODE 1st gen :)

    In material editor, i’m trying to add a background color to the : Line Patterns Material.
    I success to show in the "INPUTS" a background color near the front color square but i don’t understand how to be effective..
    I need to add a brightness to this background color too.

    Finally i want to delete the Auto With Move / Auto Width / Auto Rotate ans Auto Scale.

    Regards
    Brice
  • bricebrice
    junior Member
    Posts: 2
    Joined: Fri Sep 14, 2018 11:54 pm

    Re: Material Editor

    by bricebrice » Tue Oct 02, 2018 10:29 pm

    I'm still looking the way of doing what I want.. :/
    Anyone ?
  • mad-matt
    garageCube team
    Posts: 779
    Joined: Mon Sep 09, 2013 5:50 pm

    Re: Material Editor

    by mad-matt » Wed Oct 03, 2018 9:15 am

    Check the existing materials code and copy / paste in your one. I can't learn you how to write GLSL / ISF in a forum post. But you will find plenty of resources with google !
  • lagelat
    junior Member
    Posts: 9
    Joined: Wed May 17, 2017 8:10 am

    Re: Material Editor

    by lagelat » Sat Jul 13, 2019 11:03 am

    It was difficult for me but I did it. There is a very usefull documentation here https://thebookofshaders.com.
    Next step is to add 3 sliders for background color and a slider for manual position of lines.
    Here is my code

    Code: Select all

    /*{ "CREDIT": "Mad Team", "DESCRIPTION": "Single line pattern with many controls.", "VSN": "1.0", "TAGS": "line,graphic", "INPUTS": [ { "LABEL": "Global/Line Width", "NAME": "width", "TYPE": "float", "DEFAULT": 0.1, "MIN": 0.0, "MAX": 1.0 }, { "LABEL": "Global/Rotation", "NAME": "base_rotation", "TYPE": "float", "DEFAULT": 0.0, "MIN": 0.0, "MAX": 360.0 }, { "LABEL": "Global/Smooth", "NAME": "smoothness", "TYPE": "float", "DEFAULT": 0.0, "MIN": 0.0, "MAX": 1.0 }, { "LABEL": "Global/Repeat", "NAME": "repeat", "TYPE": "int", "DEFAULT": 1, "MIN": 1, "MAX": 16 }, { "LABEL": "Global/BPM Sync", "NAME": "bpmsync", "TYPE": "bool", "DEFAULT": false, "FLAGS": "button" }, { "LABEL": "Move/Auto Move", "NAME": "automoveactive", "TYPE": "bool", "DEFAULT": true, "FLAGS": "button" }, { "LABEL": "Move/Size", "NAME": "automovesize", "TYPE": "float", "DEFAULT": 1.0, "MIN": 0.0, "MAX": 1.0 }, { "LABEL": "Move/Speed", "NAME": "automovespeed", "TYPE": "float", "DEFAULT": 1, "MIN": 0.0, "MAX": 3.0 }, { "LABEL": "Move/Reverse", "NAME": "automovereverse", "TYPE": "bool", "DEFAULT": false, "FLAGS": "button" }, { "LABEL": "Move/Strob", "NAME": "automovestrob", "TYPE": "float", "DEFAULT": 0.0, "MIN": 0.0, "MAX": 1.0 }, { "LABEL": "Move/Shape", "NAME": "automoveshape", "TYPE": "long", "VALUES": ["Smooth","In","Out","Linear","Cut"], "DEFAULT": "In", "FLAGS": "generate_as_define" }, { "LABEL": "Width/Auto Width", "NAME": "autowidthactive", "TYPE": "bool", "DEFAULT": false, "FLAGS": "button" }, { "LABEL": "Width/Size", "NAME": "autowidthsize", "TYPE": "float", "DEFAULT": 1, "MIN": 0.0, "MAX": 1.0 }, { "LABEL": "Width/Speed", "NAME": "autowidthspeed", "TYPE": "float", "DEFAULT": 1.0, "MIN": 0.0, "MAX": 3.0 }, { "LABEL": "Width/Reverse", "NAME": "autowidthreverse", "TYPE": "bool", "DEFAULT": false, "FLAGS": "button" }, { "LABEL": "Width/Strob", "NAME": "autowidthstrob", "TYPE": "float", "DEFAULT": 0.0, "MIN": 0.0, "MAX": 1.0 }, { "LABEL": "Width/Shape", "NAME": "autowidthshape", "TYPE": "long", "VALUES": ["Smooth","In","Out","Linear","Cut"], "DEFAULT": "In", "FLAGS": "generate_as_define" }, { "LABEL": "Rotate/Auto Rotate", "NAME": "autorotateactive", "TYPE": "bool", "DEFAULT": false, "FLAGS": "button" }, { "LABEL": "Rotate/Speed", "NAME": "autorotatespeed", "TYPE": "float", "DEFAULT": 1.0, "MIN": 0.0, "MAX": 3.0 }, { "LABEL": "Rotate/Reverse", "NAME": "autorotatereverse", "TYPE": "bool", "DEFAULT": false, "FLAGS": "button" }, { "LABEL": "Rotate/Strob", "NAME": "autorotatestrob", "TYPE": "float", "DEFAULT": 0.0, "MIN": 0.0, "MAX": 1.0 }, { "LABEL": "Scale/Auto Scale", "NAME": "autoscaleactive", "TYPE": "bool", "DEFAULT": false, "FLAGS": "button" }, { "LABEL": "Scale/Size", "NAME": "autoscalesize", "TYPE": "float", "DEFAULT": 1, "MIN": 0.0, "MAX": 1.0 }, { "LABEL": "Scale/Speed", "NAME": "autoscalespeed", "TYPE": "float", "DEFAULT": 1.0, "MIN": 0.0, "MAX": 3.0 }, { "LABEL": "Scale/Reverse", "NAME": "autoscalereverse", "TYPE": "bool", "DEFAULT": false, "FLAGS": "button" }, { "LABEL": "Scale/Strob", "NAME": "autoscalestrob", "TYPE": "float", "DEFAULT": 0.0, "MIN": 0.0, "MAX": 1.0 }, { "LABEL": "Scale/Shape", "NAME": "autoscaleshape", "TYPE": "long", "VALUES": ["Smooth","In","Out","Linear","Cut"], "DEFAULT": "In", "FLAGS": "generate_as_define" }, { "LABEL": "Color/Front Color", "NAME": "front_color", "TYPE": "color", "DEFAULT": [ 1.0, 1.0, 1.0, 1.0 ] }, { "LABEL": "Color/Brightness", "NAME": "brightness", "TYPE": "float", "MIN": -1.0, "MAX": 1.0, "DEFAULT": 0.0 }, { "LABEL": "Color/Contrast", "NAME": "contrast", "TYPE": "float", "MIN": 1.0, "MAX": 3.0, "DEFAULT": 1 }, { "Label": "Color/Back Color", "NAME": "backgroundColor", "TYPE": "color", "DEFAULT": [ 0.0, 0.0, 0.0, 1.0 ] }, ], "GENERATORS": [ { "NAME": "move_position", "TYPE": "time_base", "PARAMS": {"speed": "automovespeed","reverse": "automovereverse", "strob": "automovestrob", "bpm_sync": "bpmsync", "speed_curve":2, "link_speed_to_global_bpm":true } }, { "NAME": "width_position", "TYPE": "time_base", "PARAMS": {"speed": "autowidthspeed","reverse": "autowidthreverse","strob": "autowidthstrob", "bpm_sync": "bpmsync", "speed_curve":2, "link_speed_to_global_bpm":true } }, { "NAME": "rot_position", "TYPE": "time_base", "PARAMS": {"speed": "autorotatespeed","reverse": "autorotatereverse","strob": "autorotatestrob", "bpm_sync": "bpmsync", "speed_curve":2, "link_speed_to_global_bpm":true } }, { "NAME": "scale_position", "TYPE": "time_base", "PARAMS": {"speed": "autoscalespeed","strob": "autoscalestrob", "bpm_sync": "bpmsync", "speed_curve":2, "link_speed_to_global_bpm":true } } ] }*/ in mat3 linePatternsMatrix; in float widthValue; vec4 materialColorForPixel(vec2 texCoord) { vec4 backColor = vec4(backgroundColor.rgb * brightness, backgroundColor.a); // Set a minimum smoothness so we avoid aliasing when rotated float minSmoothness = 0.001 * repeat; float finalSmoothness = minSmoothness + smoothness/2; float halfFinalWidth = width * widthValue / 2; vec2 uv = (vec3(texCoord,1) * linePatternsMatrix).xy; float dist=fract(uv.x*repeat + halfFinalWidth) - halfFinalWidth; // Be sure we can fill the screen with lines (when width==1) even with this min smoothness (that avoids aliasing on edges) dist *= (1-2*minSmoothness); float value; if (dist>0) value=1-smoothstep(halfFinalWidth-finalSmoothness,halfFinalWidth,dist); else value=1-smoothstep(-halfFinalWidth+finalSmoothness,-halfFinalWidth,dist); vec3 col =value*front_color.rgb; // Apply contrast col.rgb = mix(vec3(0.5), col.rgb, contrast); // Apply brightness col.rgb += vec3(brightness); vec4 front = vec4(value*col,1); return mix(backColor,front,0.5); }
  • lagelat
    junior Member
    Posts: 9
    Joined: Wed May 17, 2017 8:10 am

    Re: Material Editor

    by lagelat » Sat Jul 13, 2019 12:29 pm

    mix is not the right function to add backgound and front... Try again...

Who is online

Users browsing this forum: No registered users and 2 guests