Coder Social home page Coder Social logo

gl3windows's Introduction

GL3 Windows

This project demonstrates how to use a modern OpenGL 3.0 to display a sphere with some procedurally distorted texture on it.

My main goal was to simulate a burning planet.

My auxiliary goal was to create an efficient (i.e. GPU-based) implementation using modern OpenGL API. Also, to create relatively simple but still useful framework for making OpenGL-based windows applications.

Here's a screenshot:
Screenshot
The flame is animated in the real-time. The noise for that is generated completely on the GPU.

Building and Running

To build, you’ll need Visual Studio 2015 update 3.

To run, you only need a Windows PC with GPU and OS supporting OpenGL 3.0 or above. There’re no runtime dependencies. In release builds, CRT is statically linked, and all required assets are embedded into the EXE.

Tested on the following systems:

  • GeForce GTX 960, Windows 10 x64
  • GeForce GT 540M, Windows 8.1 x64
  • Intel HD 3000, Windows 8.1 x64 – had to downgrade OpenGL to 3.1 (initially it was 4.0).
  • Intel HD 4000, Windows 10 x64
  • VmWare 12, Windows 7 x86 – that was interesting. In the release notes, VmWare wrote “Advanced graphics, OpenGL 3.3” but apparently that’s not true. The hardware doesn’t even support OpenGL 3.1 GLSL. Literally, the API said “GLSL 1.40 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES”. Fortunately, my shaders were OK with downgrade to GLSL 1.3 that’s part of OpenGL 3.0. Also, I had to implement manual S3 texture decompression. The virtual GPU doesn't support GLEW_EXT_texture_compression_s3tc extension.

Controls

Left mouse drag – rotate the sphere.

Up/down keys (or ‘8’ / ‘2’ on numeric keypad) – adjust noise zoom.

Left/right keys (or ‘4’ / ‘6’ on numeric keypad) – adjust speed.

Plus/minus keys – adjust distortion intensity.

Enter or ‘5’ on numeric keypad – reset everything.

Alt+Enter – toggle fullscreen.

Pre-Existing IP

This project includes some open source parts.

DirectX Tool Kit
(c) Microsoft
MIT License
https://github.com/Microsoft/DirectXTK

OpenGL Extension Wrangler Library
Modified BSD License, the Mesa 3-D License (MIT) and the Khronos License (MIT).
https://github.com/nigels-com/glew

DXT Decompress
Custom permissive license
https://bitbucket.org/Anteru/dxt-decompress

Simplex noise
(c) Ashima Arts
Custom permissive license
https://raw.githubusercontent.com/ashima/webgl-noise/master/LICENSE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.