Tut Basic Shape 1

Written by

in

{“vs_code”:”/*MY_VERTEX_SHADER*/\r\n/* #version 330 core */\r\n varying vec2 vUv;\r\n void main() {\r\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\r\n vUv = uv;\r\n}”,”fs_code”:”/*MY_FRAGMENT_SHADER*/\n\n// Screen/Window resolution (width and height of window)\nuniform vec2 u_resolution;\n\nvoid main() {\n vec2 uv = gl_FragCoord.xy/u_resolution.xy;\n vec3 red = vec3(1.0,0.0,0.0);\n vec3 green = vec3(0.0,1.0,0.0);\n \n vec4 finalColor = vec4(0.0,0.0,0.0,1.0);\n if(uv.x >= 0.5) { \n finalColor=vec4(red, 1.0);\n } else {\n finalColor=vec4(green, 1.0);\n }\n gl_FragColor=finalColor;\n}”,”uniforms”:{“u_time”:{“type”:”f”,”value”:0,”editable”:false},”u_resolution”:{“type”:”v2″,”value”:{“x”:825,”y”:411},”editable”:false},”u_mouse”:{“type”:”v2″,”value”:{“x”:0.22087298768939395,”y”:0.44908138377243007},”editable”:false}},”description”:”Info about your shader.”,”threeJsSettings”:{“showFloor”:false,”ambientLight”:true,”directionalLight”:true,”selected3DObject”:”Plane”},”attributes”:{“isPublic”:true,”defaultIndex”:1,”categoryId”:31}}