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

Rendering artifact on CPU mode (no artifact on GPU). #116

Open
generalistr6 opened this issue Dec 16, 2016 · 4 comments
Open

Rendering artifact on CPU mode (no artifact on GPU). #116

generalistr6 opened this issue Dec 16, 2016 · 4 comments
Assignees

Comments

@generalistr6
Copy link

I found artifact on rendered image on kUseSingleCpu. (I'll share artifact image later)
When I change to kUseSingleGpu, it was fixed.
Who do you ever have any experience that the two rendered image are different on CPU and GPU?
If this issue is already known, can I know what is occur this?

@generalistr6
Copy link
Author

generalistr6 commented Jan 11, 2017

I attached the obj file which could reproduce CPU rendering artifact.
jean_hood_only.zip
This garment obj has thickness mesh. I think thickness could cause artifact.
When I test the obj doesn't has thickness mesh, no artifact occurred.

[CPU Result]

  • There is artifact like black spots.
    jean_hood_only_green cpu

[GPU Result]
jean_hood_only_green gpu

@generalistr6 generalistr6 reopened this Jan 11, 2017
@generalistr6 generalistr6 changed the title Rendering results are different between CPU and GPU. Rendering artifact on CPU mode (no artifact on GPU). Jan 11, 2017
@beasterio
Copy link
Contributor

I have tried model from jean_hood_only.zip, but output looks ok
[CPU]
jean_hood_cpu

[GPU]
jean_hood_gpu

@yozhijk
Copy link
Contributor

yozhijk commented Jan 16, 2017

@generalistr6 , can you check with the latest version and provide your hw spec if the issue still persist?

@generalistr6
Copy link
Author

Yes, still persist on the lasted version.
CPU : Intel Core i7-4790K 4.0 GHz
GPU : Nvidia GTX 750Ti
RAM : 16GB

I changed the image size to 1024 x 1024.

int g_window_width = 1024;
int g_window_height = 1024;

And, I recommend the camera state as below. The camera projection scale seems affect the result in my case.

	float3 min = float3(std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
	float3 max = float3(std::numeric_limits<float>::min(), std::numeric_limits<float>::min(), std::numeric_limits<float>::min());

	for (int i = 0; i < g_scene->vertices_.size(); ++i)
	{
		auto& v = g_scene->vertices_[i];

		min.x = std::min(min.x, v.x);
		min.y = std::min(min.y, v.y);
		min.z = std::min(min.z, v.z);

		max.x = std::max(max.x, v.x);
		max.y = std::max(max.y, v.y);
		max.z = std::max(max.z, v.z);
	}

	auto diagonalLength = std::sqrtf((max.x - min.x) * (max.x - min.x) + (max.y - min.y) * (max.y - min.y) + (max.z - min.z) * (max.z - min.z));
	g_camera_pos = float3((max.x + min.x) * 0.5f, (max.y + min.y) * 0.5f, max.z + diagonalLength);
	g_camera_at = float3((max.x + min.x) * 0.5f, (max.y + min.y) * 0.5f, (max.z + min.z) * 0.5f);
	g_camera_up = float3(0.f, 1.f, 0.f);

    g_scene->camera_.reset(new PerspectiveCamera(
        g_camera_pos
        , g_camera_at
        , g_camera_up));

image

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

3 participants