Archived

This topic is now archived and is closed to further replies.

cubic environnement mapping

This topic is 4956 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello peolple i have some troubles, i will become crazzy i''m trying to do cubic environnment mapping i can sussefully render the scene to a cubemap. Then when i map the Cubmap over a teapot , like in DX SDK i got some strange artefacts see that link below http://perso.wanadoo.fr/malakoff/TeaPot.JPG I don''t know what happens , but the cube mapped texture is pixelized, and looks ugly. This is how i do the effect: 1=====I render the scene 6 times, to the cubemap texture. 2=====I activate the effect: device.SetTextureStageState 0, D3DTSS_TEXCOORDINDEX, (D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR) 3=====I set the cubemap texture to the device 4====I render the teapot 5=====I deactivate the cameraspace reflection device.SetTextureStageState 0, D3DTSS_TEXCOORDINDEX, D3DTSS_TCI_PASSTHRU Where am i wrong? someone knows how to perfom that effect in visual basic.

Share this post


Link to post
Share on other sites
two thoughts,
maybe the cubemap texture is too low res for you''r tast,
or it actualy looks like the normals of the polys arn''t smooth, might you have turned off garoude shadeing or changed the normals or something

Bobboau, bringing you products that work... in theory

Share this post


Link to post
Share on other sites
Even if i increase the resolution of the cubemap, or i switch between different shading mode.

No change, i always have a strange cubemapping on my teapot.

Not that i do not use any shader, i do that with oldfashion method.

Any suggestion or code?

Share this post


Link to post
Share on other sites
I haven''t played with environment mapping in a while, but it looks like the coordinates being generated for the cube map are not correct. Try having DX normalize all of your normal vectors.

I''ve never used C# but I think the code would be like this:
device.RenderState.NormalizeNormals = true;

neneboricua

Share this post


Link to post
Share on other sites
Even if force DX to normalize normals, the texture mapped over the teapot looks pixelized and strange.

i use
DEVICE.SetRenderState D3DRS_NORMALIZENORMALS, true

Share this post


Link to post
Share on other sites
What about filtering? Do you turn that off? I haven''t worked much with cubemapping, so I don''t know if that''s even related. Just throwing the option out.

Chris

Share this post


Link to post
Share on other sites
I played a bit with txture filter and mimmap filter
i set the cubemap filter to bilinear

But that does not help

i still get this result

http://perso.wanadoo.fr/malakoff/TeaPot.JPG

if that can help, i have a GForce FX 5200
with the latest Nvidia driver

What can be the problem?

Share this post


Link to post
Share on other sites