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

Environment brightness, contrast, saturation restore with 3d LUT. #42761

Merged
merged 1 commit into from
Nov 28, 2020

Conversation

fire
Copy link
Member

@fire fire commented Oct 13, 2020

Co-authored-by: CptPotato
Co-authored-by: QbieShay

Restored brightness, contrast, saturation adjustments.

Bugsquad edit: This closes #41257.

See also godotengine/godot-proposals#1382

@fire fire requested a review from a team as a code owner October 13, 2020 03:26
@fire fire force-pushed the color-grading-3d branch 4 times, most recently from ebe5c46 to 58e1022 Compare October 13, 2020 03:50
@akien-mga akien-mga added this to the 4.0 milestone Oct 13, 2020
@akien-mga akien-mga requested review from reduz and clayjohn October 13, 2020 06:46
@fire fire force-pushed the color-grading-3d branch 3 times, most recently from 04bee64 to 6d6c254 Compare October 13, 2020 14:56
@fire
Copy link
Member Author

fire commented Oct 13, 2020

Ready for review.

@fire
Copy link
Member Author

fire commented Oct 13, 2020

@fire fire force-pushed the color-grading-3d branch from 6d6c254 to 1f05098 Compare October 13, 2020 16:12
@fire fire force-pushed the color-grading-3d branch from 1f05098 to 98b965c Compare October 18, 2020 19:05
@fire
Copy link
Member Author

fire commented Oct 18, 2020

Setting the Color correction [now] sets the screen grey and still doesn't work. Revised with Reduz's comments.

@fire
Copy link
Member Author

fire commented Nov 11, 2020

Will rebase.

@fire fire force-pushed the color-grading-3d branch 4 times, most recently from 2179ca1 to 3a3391d Compare November 11, 2020 23:50
@fire fire changed the title Environment brightness, contrast, saturation restore. Environment brightness, contrast, saturation restore with 3d LUT. Nov 12, 2020
@fire fire force-pushed the color-grading-3d branch 2 times, most recently from 4217124 to de30318 Compare November 15, 2020 22:51
@Darkinggq
Copy link

LUT 3D 16x1 will future replace the old 8x8 ?
image

@fire
Copy link
Member Author

fire commented Nov 22, 2020 via email

@fire fire marked this pull request as draft November 23, 2020 07:48
@fire fire force-pushed the color-grading-3d branch 2 times, most recently from 8aa7b58 to e19c628 Compare November 23, 2020 08:18
@fire
Copy link
Member Author

fire commented Nov 23, 2020

Used ClayJohn's revision.

void Environment::set_adjustment_color_correction(Ref<Texture> p_color_correction) {
	adjustment_color_correction = p_color_correction;
	Ref<GradientTexture> grad_tex = p_color_correction;
	if (grad_tex.is_valid()) {
		if (!grad_tex->is_connected(CoreStringNames::get_singleton()->changed, callable_mp(this, &Environment::_update_adjustment))) {
			grad_tex->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Environment::_update_adjustment));
			if (grad_tex->get_gradient().is_valid() && !grad_tex->get_gradient()->is_connected(CoreStringNames::get_singleton()->changed, callable_mp(this, &Environment::_update_adjustment))) {
				grad_tex->get_gradient()->connect(CoreStringNames::get_singleton()->changed, callable_mp(this, &Environment::_update_adjustment));
			}
		}
	}
	Ref<Texture2D> adjustment_texture_2d = adjustment_color_correction;
	if (adjustment_texture_2d.is_valid()) {
		use_1d_color_correction = true;
	} else {
		use_1d_color_correction = false;
	}
	_update_adjustment();
}

Also restored hard-coded gradient texture updating support. Probably want to make a note that if there's no hard coding, an editor restart is needed.

@fire fire marked this pull request as ready for review November 23, 2020 08:22
@fire fire requested a review from clayjohn November 23, 2020 08:22
servers/rendering/rasterizer_rd/rasterizer_effects_rd.h Outdated Show resolved Hide resolved
scene/resources/texture.cpp Outdated Show resolved Hide resolved
scene/resources/environment.cpp Show resolved Hide resolved
scene/resources/environment.cpp Outdated Show resolved Hide resolved
Copy link
Member

@clayjohn clayjohn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woohoo! Great work!

@akien-mga akien-mga requested a review from reduz November 25, 2020 07:55
@reduz
Copy link
Member

reduz commented Nov 27, 2020

Looks ok to me

@akien-mga
Copy link
Member

Note that the "Co-authored-by:" fields for @CptPotato and @QbieShay don't seem to work, I think you need to include their email (check their recently used name + email in git log).

@fire fire force-pushed the color-grading-3d branch 2 times, most recently from 5f23a0d to 076908b Compare November 28, 2020 15:37
…ction.

Allow gradients and 2d images.

Use shader versions for LUT in tonemap

Co-authored-by: alex-poe <3957610+CptPotato@users.noreply.github.com>
Co-authored-by: QbieShay <cislaghi.ilaria@gmail.com>
Co-authored-by: Clay John <claynjohn@gmail.com>
@fire
Copy link
Member Author

fire commented Nov 28, 2020

@akien-mga Done.

@akien-mga akien-mga merged commit ef2d1f6 into godotengine:master Nov 28, 2020
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vulkan: Adjustments (brightness/contrast/saturation) not reimplemented yet
6 participants