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

smoother holes #73

Closed
pgruenbacher opened this issue Mar 2, 2019 · 4 comments
Closed

smoother holes #73

pgruenbacher opened this issue Mar 2, 2019 · 4 comments

Comments

@pgruenbacher
Copy link

Hi Zylann,

You got any idea on how to increase the resolution on the color map texture (for hole masks)?

screenshot from 2019-03-02 17-51-17

Actually in the process I ended up thinking of a solution... your simple4.shader is getting the tint texture in the vertex shader instead of fragment (for perf. reasons, but that explains why the holes match the vertices LOD...). But I think LOD holes are non-ideal since they can become quite obvious at far distances...

I'll keep the issue to document my progress..

@pgruenbacher
Copy link
Author

pgruenbacher commented Mar 2, 2019

screenshot from 2019-03-02 18-02-03

ah ok so moving the code to the fragment does the trick...

void fragment() {
	vec4 v_tint = texture(u_terrain_colormap, UV);
	if(v_tint.a < 0.5) {
			// TODO Add option to use vertex discarding instead, using NaNs
			discard;
}

now i just need to figure out how to do antialiasing in the color texture when drawing to it...

@pgruenbacher
Copy link
Author

godotengine/godot#10241
looks like antialising doesn't work on godot 3.1 or 3.0 from what I can tell... guess will have to wait then...

@Zylann
Copy link
Owner

Zylann commented Mar 3, 2019

Note that in practice, I don't intent to make holes "beautiful". They exist because it allows to place a mesh on top of the edges, which are not supposed to be seen in the end. For example, a cave entrance or a tunnel should have rocks or bricks all around the hole. I even considered not using discard in the vertex shader and discard vertices instead.

@pgruenbacher
Copy link
Author

pgruenbacher commented Mar 3, 2019 via email

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

2 participants