Texture mapping and cursing C++

struct Texel
Texel(float u, float v) : u(u), v(u) {}
float u, v;

Yeah, look carefully. Both u and v are the same, and you spend quite a while wondering why you get renders like this:not a great picture at allThe only consolation is that when you’ve fixed the problem, you get something like this:

nice picture

That pretty map of the world came from the wikipedia, and appears to be free for any use. In case anyone is going to call me up on my statement last time, the C++ counts as content đŸ˜‰


2 Responses to “Texture mapping and cursing C++”

  1. looks cool, could you wrap that texture around say a sphere ?

    Might be the image quality, but there is a hint of aliasing at your checker board pattern. and where the planes are intersecting.

    Also I have a little difficulties see if the reflection is correct at the bottom (the top wall reflection looks correct)

  2. bbarrett Says:

    Hi, thanks for your comment. Nice to know people are reading!

    Yes, since then I have implemented texture mapping on spheres. I might post some screen shots in the next few days.

    Aliasing is a large problem for my raytracer at the moment as I haven’t added any super-sampling. I had some code in that did some filtering on the textures by averaging 4 samples, but this resulted in odd grey lines on the checkerboard texture.

    Looking at the reflection, it seems OK. I mean, I can see the reflection of the polar ice, and south america and africa. I don’t think one would be able to see the reflected checker pattern on the floor because it… well, mirrors the pattern :). However, I’ll try some tests and see if I can get any odd looking renders. At the moment I have my code broken while I add more stuff.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: