Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CubeMap support #537

Merged
merged 3 commits into from
Mar 19, 2017
Merged

CubeMap support #537

merged 3 commits into from
Mar 19, 2017

Conversation

luboslenco
Copy link
Contributor

@luboslenco luboslenco commented Mar 18, 2017

Adds support for handling cubemaps. As usual, took a bit longer than anticipated.

  • CubeMap class works exactly like Image class
  • WebGL is ready, will also do Kore/Krom
  • Tested & working, some PR typos or minor issues can arise though
  • Only render target functionality implemented so far
// Creating a cubemap
var cubemap = CubeMap.createRenderTarget(...);

// Render to cubemap using layered rendering
// Draw to all faces at once using geometry shader
// WebGL is not capable of this
cubemap.g4.begin();

// Render to desired face
// 0: x+, 1: x-, 2: y+, 3: y-, 4: z+, 5: z-
cubemap.g4.beginFace(face);

// Attach cubemap to samplerCube unit
g4.setCubeMap(cubemap);

// Attach cubemap depth buffer to samplerCube unit
g4.setCubeMapDepth(cubemap);

@RobDangerous RobDangerous merged commit 1f8dff2 into Kode:master Mar 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants