WebGL OpenGL GLSL Shader Tests
How do I make an webgl opengl glsl shader tests?
Simple rpg gradient shader reacting to viewport size. What is a webgl opengl glsl shader tests? How do you make a webgl opengl glsl shader tests? This script and codes were developed by Michaela on 27 July 2022, Wednesday.
WebGL OpenGL GLSL Shader Tests - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>WebGL OpenGL GLSL Shader Tests</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ html,
body { overflow: hidden; width: 100%; height: 100%;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <script id="fragShader" type="shader-code"> uniform vec2 resolution; void main() { vec2 pos = gl_FragCoord.xy / resolution.xy; gl_FragColor = vec4(0.75,pos.x,pos.y,1.0); }
</script> <script src='https://cdnjs.cloudflare.com/ajax/libs/three.js/r71/three.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
WebGL OpenGL GLSL Shader Tests - Script Codes CSS Codes
html,
body { overflow: hidden; width: 100%; height: 100%;
}
WebGL OpenGL GLSL Shader Tests - Script Codes JS Codes
var scene, camera, renderer;
var geometry, material, mesh;
var uniforms = {};
function setup () { scene = new THREE.Scene(); camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 ); renderer = new THREE.WebGLRenderer(); renderer.setSize( window.innerWidth, window.innerHeight ); document.body.appendChild( renderer.domElement );
}
function createObject () { var fragShaderCode; fragShaderCode = document.getElementById( 'fragShader' ).innerHTML; uniforms.resolution = { type:'v2',value:new THREE.Vector2( window.innerWidth,window.innerHeight ) }; geometry = new THREE.BoxGeometry( 1, 1, 1 ); material = new THREE.ShaderMaterial( { uniforms:uniforms, fragmentShader: fragShaderCode } ); mesh = new THREE.Mesh( geometry, material ); scene.add( mesh ); mesh.position.z = -3;
}
function render() { mesh.rotation.x += 0.0025; mesh.rotation.y += 0.0025; mesh.rotation.z += 0.0025; requestAnimationFrame( render ); renderer.render( scene, camera );
}
function onWindowResize () { uniforms.resolution.value.x = window.innerWidth; uniforms.resolution.value.y = window.innerHeight; camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); renderer.clear(); renderer.setSize( window.innerWidth, window.innerHeight );
}
setup();
createObject();
render();
window.addEventListener( 'resize', onWindowResize );
onWindowResize();
Developer | Michaela |
Username | Fischaela |
Uploaded | July 27, 2022 |
Rating | 3 |
Size | 2,586 Kb |
Views | 78,936 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Geildanke team | 4,153 Kb |
Animation tests | 2,748 Kb |
Figure caption hover effect | 4,946 Kb |
Geildanke products | 5,250 Kb |
News reading experiment | 6,961 Kb |
WebGL Game Endless Runner | 6,354 Kb |
Projects geildanke with new animations | 6,186 Kb |
HTML5 game experiment with CreateJS | 4,135 Kb |
Timeline scribble | 4,488 Kb |
Geildanke typography | 3,249 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Drop Cap | Gsaiki | 1,571 Kb |
CSS only simple parallax scroll | Stanssongs | 3,708 Kb |
React Markdown Previewer | C0d0er | 3,190 Kb |
Filter inputs | Rowinf | 1,721 Kb |
Hamburger Menu Animation | Salmanraza | 2,580 Kb |
CSS Donut Charts | Seanstopnik | 2,908 Kb |
Svg penguin | _massimo | 2,990 Kb |
Sitemap generator for Sharepoint | Gyusza | 2,518 Kb |
CSS3 Form | Tusharbandal | 1,836 Kb |
AngularJS Skills | Supro | 3,312 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!