PDA

View Full Version : OpenGL texturing very unexact?



BlackJack
06-20-2002, 08:01 AM
Ok, I have a little problem with my light mapping. I am drawing a couple of palm trees, which are throwing a shadow on the landscape. But sometimes these shadows have not the right position. A bit for too left, too right and so on. It's always just relative minimal, but good visibile nevertheless. I checked the values of everything and all seems to be 100% correct from my side, but nevertheless sometimes the shadows are not exactly where they should be.

Here a picture to show, what's the problem: http://www.lyxion.com/images/textbug.jpg

I guess the card is doing this as an optimization, but in some ways it's also hard for me to imagine, that it can be soooo extreme unexact. Is there a possibility to increase how exact/unexact the texturing is done or is it for sure a bug in my shadowmap calculation functions?

Thanks,

Michael

[This message has been edited by BlackJack (edited 06-20-2002).]

Korval
06-20-2002, 07:27 PM
Try improving the resolution of your shadow map. As just a debug test, take it up to the maximum for your card.

zed
06-20-2002, 08:07 PM
are the trees actually interpenertrating (oh er) the surface?

dorbie
06-20-2002, 08:17 PM
This is much too inexact. It is NOT OpenGL it is your application. Make sure your trees are in the same position when drawing the shadow texture as when drawing the scene. Do you have more than one tree model? Are the trees sitting on the surface, etc. Are they getting rotated around a slightly offset origin?

Start with the assumption that this MUST be in your application and you'll have a chance of solving it.

One caveat, if the modeling transformations to translate the trees to their positions have some truly massive mumbers in them them there is a chance that this is precision, but I doubt that's what you are doing.

[This message has been edited by dorbie (edited 06-20-2002).]

BlackJack
06-20-2002, 10:52 PM
I finally got it solved and yes... it was my application --> my dumbness. I debugged me to death about it and saw nothing which could it be... if there hadn't been the missing *2 in a part of the height calculation http://www.opengl.org/discussion_boards/ubb/wink.gif. I'd also been shocked if the GeForce had really had such a tollerance, but after 2 hours of checking all UVs, the shadowmap calculation and so on I got more and more sure it could be GL... yeah, yeah, I know... always the way : It wasn't me, I'm doing nothing wrong, it was the bad bad bad uncle GL http://www.opengl.org/discussion_boards/ubb/smile.gif, hehe.

Thanks in any case,

Michael

knackered
06-20-2002, 11:39 PM
Uncle GL?!