Skip to content

🍏 CSharpGL wraps OpenGL API(buffer, shader, texture, matrix, state etc) and demostrates how to express high-level functions(scene, text, picking, UI etc) with CSharpGL library.

ihaiucom/CSharpGL

 
 

Repository files navigation

CSharpGL

# Object Oriented OpenGL in C\# :crystal_ball:[Wiki](https://github.com/bitzhuwei/CSharpGL/wiki) | 🥚[nuget](https://www.nuget.org/packages/CSharpGL) | 🍞[CSharpGL.dll](https://raw.githubusercontent.com/bitzhuwei/CSharpGL/master/CSharpGL/CSharpGL.dll) [CSharpGL](https://github.com/bitzhuwei/CSharpGL) wraps OpenGL API(buffer, shader, texture, matrix, state etc) and demonstrates how to express high-level functions(scene, text, picking, UI etc) with CSharpGL library. ![modern-rendering](https://github.com/bitzhuwei/CSharpGL/blob/gh-pages/images/CSharpGL/modern-rendering.gif?raw=true) ## 📌Color-Coded Picking `IColorCodedPicking` supports picking primitives in multiple vertex buffer objects using Mouse. ![pick and move primitive](http://images2015.cnblogs.com/blog/383191/201605/383191-20160503191610388-117673971.gif) ## 🔘☑️`UIRenderer` & Text Rendering 'Control' at fixed position with fixed size. For example, ``UIAxis`` renders an axis at left bottom corner. All kinds of controls binds to specified border just like winform-control. Rendering text using ``glRasterPos()`` and ``CallList()``.(Obsolete) Rendering text using ``UIText``. ![UIText and UIAxis](https://github.com/bitzhuwei/CSharpGL/blob/gh-pages/images/CSharpGL/GLText-GLAxis.png?raw=true)

export-glyph-texture-from-TTF

💎Some Cool Demos

Image Processing using Compute Shader.

Simple edge-detection implemented by compute shader.
compute-shader-image-processing

Raycast Volume Rendering using 3D texture.

raycast-volume-rendering

Particle Simulator using Compute Shader.

Particle's speed and position is updated by compute shader.
compute-shader-particles
compute-shader-particles

Order-Dependent Transparency VS Order-Independent Transparency.

order-independent-transparency

Point Sprite.

10000 particles with a sphere inside a cube. point-sprite

Generated Klein Bottle.

Klein Bottle

Earth.

An earth model that singly rotates same as real earth. It's composed of 65341 positions, normals and uvs and 130140 indexes and a 10800x5400 texture. earth

🆔💯Billboard and LabelRenderer

Billboard can be used to display health-bar, damage numbers in game application. LabelRenderer renders a string at specified position which always faces camera.
billboard-health-bar-text

🔆Light

ambient, diffuse and specular light effect from directional light.
Direcional-light

🎥Scene Editor

Useful tool to build a scene and feels how opengl's transform system works. CSharpGL-Scene-Editor

🍟Renderer Generator

RendererGenerator is a tiny console that reads an xml config file and dumps a Renderer.cs, a Model.cs, a vertex shader file(.vert) and a fragment shader file(.frag). A demo is shown as below:

<?xml version="1.0" encoding="utf-8"?>
<RendererGenerator TargetName="Demo" ZeroIndexBuffer="false" DrawMode="Points">
  <VertexAttribute NameInShader="in_Position" NameInModel="position" AttributeType="vec3" />
  <VertexAttribute NameInShader="in_TexCoord" NameInModel="texCoord" AttributeType="vec2" />
</RendererGenerator>

❓Support or Contact

Check my blog here or join my QQ GroupCSharpGL(C#+OpenGL).

About

🍏 CSharpGL wraps OpenGL API(buffer, shader, texture, matrix, state etc) and demostrates how to express high-level functions(scene, text, picking, UI etc) with CSharpGL library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 98.0%
  • Smalltalk 1.8%
  • Other 0.2%