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

Comments: Fast, Constant Time Sphere Indexing, Part 1 #18

Open
dwilliamson opened this issue Nov 20, 2018 · 7 comments
Open

Comments: Fast, Constant Time Sphere Indexing, Part 1 #18

dwilliamson opened this issue Nov 20, 2018 · 7 comments

Comments

@dwilliamson
Copy link
Owner

dwilliamson commented Nov 20, 2018

http://donw.io/post/sphere-indexing/

@redblobgames
Copy link

redblobgames commented Nov 23, 2018

Cool article! Minor suggestion for less distracting colors:

	if (tri_index == 0) debug_colour = vec3(0.7, 0.5, 0.2);
	if (tri_index == 1) debug_colour = vec3(0.6, 0.7, 0.2);
	if (tri_index == 2) debug_colour = vec3(0.2, 0.7, 0.2);
	if (tri_index == 3) debug_colour = vec3(0.2, 0.7, 0.6);
	if (tri_index == 4) debug_colour = vec3(0.2, 0.5, 0.7);
	if (tri_index == 5) debug_colour = vec3(0.3, 0.2, 0.7);
	if (tri_index == 6) debug_colour = vec3(0.7, 0.2, 0.7);
	if (tri_index == 7) debug_colour = vec3(0.7, 0.2, 0.3);

It makes the outlines around the cyan and green triangles easier to see. (I generated the values with python code and then tweaking)

import colorsys
for a in range(8):
    print("if (tri_index == %d) debug_colour = vec3(%.1f, %.1f, %.1f)" % ((a, ) + colorsys.hsv_to_rgb((30 + a*360/8)/360.0, 0.8, 0.8)))

screen shot

@dwilliamson
Copy link
Owner Author

Ahh, thanks for trying this out but I think I prefer the original colours.

<scrolls up> My eyes! 🙈

I think I'll add your colours 😄

@matthewarcus
Copy link

Interesting problem. After playing around a bit I came up with this pleasantly simple method: https://www.shadertoy.com/view/MlVfzG

@dwilliamson
Copy link
Owner Author

dwilliamson commented Nov 24, 2018

Good job! You hit on the exact method I'll be covering in part 2 😃 It's very similar to Octahedron Normal Encoding, which was how I stumbled on it myself.

(code here: https://gist.github.com/dwilliamson/efe4c2e09ad0c223be8e)

@matthewarcus
Copy link

Yup, that looks like the business. I've always wondered why people didn't use octahedral environment mappings more.

@dwilliamson dwilliamson changed the title Fast, Constant Time Sphere Indexing, Part 1 Comments: Fast, Constant Time Sphere Indexing, Part 1 Feb 6, 2019
@HeorhiiPotapov
Copy link

very nice!!! good job)

@Feelcame
Copy link

cool

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

No branches or pull requests

5 participants