Re: [pygame] shadow demo

2008-09-15 Thread Ian Mallett
On Mon, Sep 15, 2008 at 6:16 PM, René Dudfield <[EMAIL PROTECTED]> wrote: > This is because the shadow mapping in that code is happening in the > frame buffer. If you move it to an off-screen buffer(FBO, or > pbuffer), then you can increase the resolution. Of course FBOs, and > pbuffers aren't a

Re: [pygame] shadow demo

2008-09-15 Thread René Dudfield
oh, I guess you haven't uploaded your changes yet? Looking forward to comparing the difference :) cu, On Tue, Sep 16, 2008 at 11:15 AM, Ian Mallett <[EMAIL PROTECTED]> wrote: > Just a word on shadow quality (previously bad). I added some nice texture > antialiasing, and added to the tutorial to

Re: [pygame] shadow demo

2008-09-15 Thread René Dudfield
Ah, nice one :) Yeah, if you're careful about light placement, then shadow mapping can look a lot nicer. Since you can avoid the cases where it doesn't look so good. cu, On Tue, Sep 16, 2008 at 11:15 AM, Ian Mallett <[EMAIL PROTECTED]> wrote: > Just a word on shadow quality (previously bad). I

Re: [pygame] shadow demo

2008-09-15 Thread René Dudfield
On Mon, Sep 15, 2008 at 10:58 AM, Ian Mallett <[EMAIL PROTECTED]> wrote: >> Have you done rendering to texture for increased shadow map >> resolution? That would really give it a nice quality boost. > > That's what shadow mapping does. Unfortunately, there is a strange > limitation which causes a

Re: [pygame] shadow demo

2008-09-15 Thread Ian Mallett
Just a word on shadow quality (previously bad). I added some nice texture antialiasing, and added to the tutorial to show how to set the light angle to effectively use the range. Ian

Re: [pygame] shadow demo

2008-09-14 Thread Ian Mallett
On Sun, Sep 14, 2008 at 5:52 PM, René Dudfield <[EMAIL PROTECTED]> wrote: > cool! It's so good that you fixed it in 5 minutes. Must have been > processing in the back of your head :) I love it when that happens. I both love it and hate it. Love--because I don't have to do much, and hate, beca

Re: [pygame] shadow demo

2008-09-14 Thread René Dudfield
cool! It's so good that you fixed it in 5 minutes. Must have been processing in the back of your head :) I love it when that happens. Have you done rendering to texture for increased shadow map resolution? That would really give it a nice quality boost. ps. if you wanted to include reference

Re: [pygame] shadow demo

2008-09-14 Thread Ian Mallett
The algorithm is the same--shadow mapping. What have I changed? Hard to say. Here's what happened: -Since beginning PyOpenGL programming nearly two years ago, I always wanted to make something using shadows. When I first started, I was still unfamiliar with Python, though I had been doing stuff

Re: [pygame] shadow demo

2008-09-14 Thread René Dudfield
Nice one. For shadows, is this using a similar algorithm to the codes posted previously? If so, what did you change? cu, On Sun, Sep 14, 2008 at 2:42 PM, Ian Mallett <[EMAIL PROTECTED]> wrote: > http://www.pygame.org/project/877/?release_id=1531 >

Re: [pygame] shadow demo

2008-09-13 Thread Ian Mallett
http://www.pygame.org/project/877/?release_id=1531

Re: [pygame] shadow demo

2008-09-13 Thread Ian Mallett
For all those poor souls who have worked so hard at shadowing...I've got it! I'll release a library which includes an easy-to-use shadow module soon! Ian

Re: [pygame] shadow demo

2008-04-12 Thread Ian Mallett
There really should be a way to increase the resolution with this algorithm... grrr. I

Re: [pygame] shadow demo

2008-04-10 Thread René Dudfield
Hi, have a look at this update to the shadow code: http://rene.f0o.com/~rene/stuff/rd_shadows2.zip Take a look at the single quad being drawn. For me it only shows the shadow for the quad for half the time. I think because back face culling or something. I still want to render to texture with

Re: [pygame] shadow demo

2008-03-26 Thread Ian Mallett
On Wed, Mar 26, 2008 at 2:31 PM, René Dudfield <[EMAIL PROTECTED]> wrote: > I've been working on some refinements, and more explanations of the > code... I'll send it along in a while. Including casting shadows with > a quad. Cool! Thanks! Ian

Re: [pygame] shadow demo

2008-03-26 Thread René Dudfield
Note that the smt page is basically where the shadow demo came from. I've been working on some refinements, and more explanations of the code... I'll send it along in a while. Including casting shadows with a quad. I still want to: - render to texture with a higher resolution shadow map. I've a

Re: [pygame] shadow demo

2008-03-26 Thread Ian Mallett
On Wed, Mar 26, 2008 at 12:28 AM, Casey Duncan <[EMAIL PROTECTED]> wrote: > On Mar 25, 2008, at 1:29 PM, Ian Mallett wrote: > > Cool! Does this work for self-shadowing? > > Sorry, no, but you could use the "shadow volumes" technique to achieve > this: > > http://www.3ddrome.com/articles/shadowvol

Re: [pygame] shadow demo

2008-03-26 Thread Casey Duncan
On Mar 26, 2008, at 12:28 AM, Casey Duncan wrote: On Mar 25, 2008, at 1:29 PM, Ian Mallett wrote: Cool! Does this work for self-shadowing? Sorry, no, but you could use the "shadow volumes" technique to achieve this: You could also use depth mapping: http://www.paulsprojects.net/tutorial

Re: [pygame] shadow demo

2008-03-26 Thread Casey Duncan
On Mar 25, 2008, at 1:29 PM, Ian Mallett wrote: Cool! Does this work for self-shadowing? Sorry, no, but you could use the "shadow volumes" technique to achieve this: http://www.3ddrome.com/articles/shadowvolumes.php -Casey

Re: [pygame] shadow demo

2008-03-25 Thread Ian Mallett
Cool! Does this work for self-shadowing?

Re: [pygame] shadow demo

2008-03-25 Thread Casey Duncan
On Mar 23, 2008, at 10:49 PM, Ian Mallett wrote: This particular instance is interesting, as I want to use shadows for an outdoor scene with directional lighting. I just need the shadows in a small area right around the camera, but they must be very high resolution. The ground, unfortunate

Re: [pygame] shadow demo

2008-03-23 Thread Ian Mallett
This particular instance is interesting, as I want to use shadows for an outdoor scene with directional lighting. I just need the shadows in a small area right around the camera, but they must be very high resolution. The ground, unfortunately, is not flat and self-shadowing on other objects is a

Re: [pygame] shadow demo

2008-03-23 Thread Alistair Buxton
> On Mon, Mar 24, 2008 at 4:05 PM, Ian Mallett <[EMAIL PROTECTED]> wrote: > > So at this resolution, the shadows can never be any higher resolution? As > > they are, they are really pixel-y, which is unacceptable. How can the > > shadows be more detailed? > > A side note: If you only want t

Re: [pygame] shadow demo

2008-03-23 Thread René Dudfield
There's a few methods... One is to make the POV of the camera smaller... but then the shadows aren't as robust. However if you're careful this is a good method to use. Rendering to an off screen buffer should make it possible to increase the shadow buffer size. On Mon, Mar 24, 2008 at 4:05 PM

Re: [pygame] shadow demo

2008-03-23 Thread Alistair Buxton
On 24/03/2008, Ian Mallett <[EMAIL PROTECTED]> wrote: > So at this resolution, the shadows can never be any higher resolution? As > they are, they are really pixel-y, which is unacceptable. How can the > shadows be more detailed? Decrease the light FOV, and you decrease the area over which the s

Re: [pygame] shadow demo

2008-03-23 Thread Ian Mallett
So at this resolution, the shadows can never be any higher resolution? As they are, they are really pixel-y, which is unacceptable. How can the shadows be more detailed?

Re: [pygame] shadow demo

2008-03-23 Thread Alistair Buxton
On 24/03/2008, Ian Mallett <[EMAIL PROTECTED]> wrote: > The demo, then, should change the size of the framebuffer, or the demo is > incomplete. > The framebuffer is literally the display surface. It's always the same size as the window, or the screen resolution if you are running fullscreen. --

Re: [pygame] shadow demo

2008-03-23 Thread Ian Mallett
The demo, then, should change the size of the framebuffer, or the demo is incomplete.

Re: [pygame] shadow demo

2008-03-23 Thread Alistair Buxton
On 24/03/2008, Ian Mallett <[EMAIL PROTECTED]> wrote: > but nowhere else. Seeing as how this is a variable, (and of course, a > shadow implementation should be adjustable to different platform > capabilities), it seems illogical that it cannot, in effect, be changed. The demo implementation draws

Re: [pygame] shadow demo

2008-03-23 Thread Ian Mallett
I can't speak for everyone, (though I assume by everyone's silence this is so), we cannot figure out how to implement the theory. In this particular case, the shadows worked when the resolution was 512, but nowhere else. Seeing as how this is a variable, (and of course, a shadow implementation

Re: [pygame] shadow demo

2008-03-23 Thread Alistair Buxton
On 22/03/2008, Ian Mallett <[EMAIL PROTECTED]> wrote: > Hasn't anyone figured this out? One would think that it can't be too > difficult. One quad over another--how hard could it be? It's pretty easy really, when you consider that opengl is a system designed around the idea of projecting 3d coor

Re: [pygame] shadow demo

2008-03-22 Thread Ian Mallett
Hasn't anyone figured this out? One would think that it can't be too difficult. One quad over another--how hard could it be?

Re: [pygame] shadow demo

2008-03-16 Thread Ian Mallett
On Sun, Mar 16, 2008 at 6:19 PM, René Dudfield <[EMAIL PROTECTED]> wrote: > Have you tried doing the quad backwards? There's CULLing going on, so > maybe that is stopping it from working. Yes. I can sometimes get shadowing working, but weird things happen, like the shadow will suddenly get disto

Re: [pygame] shadow demo

2008-03-16 Thread René Dudfield
Have you tried doing the quad backwards? There's CULLing going on, so maybe that is stopping it from working. On Sun, Mar 16, 2008 at 3:09 PM, Ian Mallett <[EMAIL PROTECTED]> wrote: > On Sat, Mar 15, 2008 at 8:45 PM, René Dudfield <[EMAIL PROTECTED]> wrote: > > > > You might need to move the lig

Re: [pygame] shadow demo

2008-03-15 Thread Ian Mallett
On Sat, Mar 15, 2008 at 8:45 PM, René Dudfield <[EMAIL PROTECTED]> wrote: > You might need to move the light around, or move the objects around > for the shadowing to work. But I've managed to use other models for > the floor and the object casting a shadow. I haven't. A single quad shadowing a

Re: [pygame] shadow demo

2008-03-15 Thread René Dudfield
hehe, yeah. or glEnable(GL_JUST_WORK); I think if you place lights in certain places the shadows can look nice. So for some uses it is pretty cool, and I guess it is fairly simple to code, and works fairly fast :) On Sat, Mar 15, 2008 at 8:46 AM, Ian Mallett <[EMAIL PROTECTED]> wrote: > > On Th

Re: [pygame] shadow demo

2008-03-15 Thread René Dudfield
You might need to move the light around, or move the objects around for the shadowing to work. But I've managed to use other models for the floor and the object casting a shadow. Yeah, rendering to a texture might be able to work... but I can't think how at the moment. Lots of different techniqu

Re: [pygame] shadow demo

2008-03-15 Thread Ian Mallett
On Fri, Mar 14, 2008 at 3:11 PM, Casey Duncan <[EMAIL PROTECTED]> wrote: > On Mar 13, 2008, at 4:12 PM, René Dudfield wrote: > > > Hello, > > > > I found some things to improve the quality of the shadow mapping, and > > written in more comments. > > > > http://rene.f0o.com/~rene/stuff/shadows_rd.z

Re: [pygame] shadow demo

2008-03-14 Thread Casey Duncan
On Mar 13, 2008, at 4:12 PM, René Dudfield wrote: Hello, I found some things to improve the quality of the shadow mapping, and written in more comments. http://rene.f0o.com/~rene/stuff/shadows_rd.zip It also by default uses a polygon as a floor, and a teapot from GLUT. There's a constant at

Re: [pygame] shadow demo

2008-03-14 Thread Ian Mallett
On Thu, Mar 13, 2008 at 5:27 PM, René Dudfield <[EMAIL PROTECTED]> wrote: > > I found out that the glutTeapot actually has a bug (mentioned on the > man page)! The polygons are wound backwards to how opengl does it by > default. So disabling the culling is only needed for the teapot. > > Does tha

Re: [pygame] shadow demo

2008-03-13 Thread René Dudfield
On Fri, Mar 14, 2008 at 11:06 AM, Ian Mallett <[EMAIL PROTECTED]> wrote: > On Thu, Mar 13, 2008 at 4:12 PM, René Dudfield <[EMAIL PROTECTED]> wrote: > > > It also by default uses a polygon as a floor, and a teapot from GLUT. > > There's a constant at the top of demoShadows.py which changes this. >

Re: [pygame] shadow demo

2008-03-13 Thread Ian Mallett
On Thu, Mar 13, 2008 at 4:12 PM, René Dudfield <[EMAIL PROTECTED]> wrote: > It also by default uses a polygon as a floor, and a teapot from GLUT. > There's a constant at the top of demoShadows.py which changes this. > However the objects you draw are a very simple part of this demo, they > could b

Re: [pygame] shadow demo

2008-03-13 Thread René Dudfield
Hello, I found some things to improve the quality of the shadow mapping, and written in more comments. http://rene.f0o.com/~rene/stuff/shadows_rd.zip It also by default uses a polygon as a floor, and a teapot from GLUT. There's a constant at the top of demoShadows.py which changes this. However

Re: [pygame] shadow demo

2008-03-12 Thread Ian Mallett
On Tue, Mar 11, 2008 at 10:32 PM, René Dudfield <[EMAIL PROTECTED]> wrote: > Hello, > > I noticed with this cool shadow demo: > http://www.pygame.org/project/556/ > > On this ATI card I have, I had to change the glAlphaFunc to use > GL_LESS... which I think is because of float inaccuracies. > > #S

[pygame] shadow demo

2008-03-11 Thread René Dudfield
Hello, I noticed with this cool shadow demo: http://www.pygame.org/project/556/ On this ATI card I have, I had to change the glAlphaFunc to use GL_LESS... which I think is because of float inaccuracies. #Set alpha test to discard false comparisons #glAlphaFunc(GL_EQUAL, 1.0) glAlphaFunc(GL_LESS,