[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] 127.5
- To: pygame-users <pygame-users@xxxxxxxx>
- Subject: [pygame] 127.5
- From: Ian Mallett <geometrian@xxxxxxxxx>
- Date: Fri, 30 Jul 2010 07:10:55 -0700
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 30 Jul 2010 10:11:12 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=FmQ8a0Jf/uJVfeY85OynpahqctRCraBU6BRIgJBYSUk=; b=PBpVowrnfGi/WK/2fHzENev+WUpIfIXL9sWg6Rf/HaUFBcAqmtApDBlko/+AP0bJSw Z0+Xd+5VwoB/NfAhKMeQgexXYB3alEhAnQfAkyjROPzyFslnIDAjdBJnKOpFZCP+IIm1 XRMN5o7Tn1CC/hFKChiCAKbVRK3M74s7vfyJs=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=kPxTLUjEbKkDf4rdJkvXoHZ5XqPfLCkZDLqraqnKMNEKAcCvEkK+VnUlADyNp3Apml NHoOYVE3r/jCxnALgOcX3SEJgUFTiIpkiQayjsWDQFKA/gI44oy4hj+kbQGug+wd4mfo 6eX0GykL6epUN4jq/acSLEY/e6+5HqoV1bp9g=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Hi,
Intro:
So, I'm working on computational fluid dynamics, and I need to initialize a velocity texture, which stores a vector field in an image. Velocity vectors can have a range of values; each component could be either positive and negative. The X component goes in the red channel, the Y in the green, and so on. To store the values, the image maps the range [0,255] to [-1.0,1.0]. I need to have a surface set to precisely velocity = 0 on all channels.
The problem:
Because of this, I need a surface filled with the color 127.5. Obviously, more than 8 bits per channel are required. To update the texture, I'm using GL_RGBA32F_ARB, which allocates 32 bits per channel. Unfortunately, the base image created by PyGame has a value of 127 â -0.00196 velocity. In practice, this leads to "drift" in the simulation. Can something be done to send a 32 bit per channel surface filled with 127.5 values to the OpenGL?
Thanks,
Ian