Tut Basic Shape 2

Written by

in

{“vs_code”:”/*MY_VERTEX_SHADER*/\n/* #version 330 core */\n varying vec2 vUv;\n void main() {\n gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n vUv = uv;\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.45 && uv.x <= 0.55 && uv.y >= 0.4 && uv.y <= 0.6)\n { \n finalColor=vec4(green, 1.0);\n }\n \n gl_FragColor=finalColor;\n }\n\n","uniforms":{"u_time":{"type":"f","value":0,"editable":false},"u_resolution":{"type":"v2","value":{"x":827,"y":409},"editable":false},"u_mouse":{"type":"v2","value":{"x":0.002818613848057739,"y":0.24097373607980593},"editable":false}},"description":"Info about your shader.","threeJsSettings":{"showFloor":false,"ambientLight":true,"directionalLight":true,"selected3DObject":"Plane"},"attributes":{"isPublic":true,"defaultIndex":1,"categoryId":31}}