Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


dave j

Member Since 11 Oct 2002
Offline Last Active Feb 28 2015 06:35 AM

Posts I've Made

In Topic: Give me your Java and Python code

28 February 2015 - 06:34 AM

For Python, many people's Python games are listed on pygame.org. They usually have links to the source.

In Topic: What Color is the darn dress?!

28 February 2015 - 06:26 AM

P.S. I think my cousin and I deserve the Nobel peace prize. He has been seeing both. He didn't know why it kept changing. But it seems to be all about where you focus. Color constancy puts the top colors of the dress as white since they are more in the light, and the lower parts of the dress as blue, since they are in shadow.


Get your cousin to try looking at it with alternate eyes closed. I have slightly different color balances between my eyes, if your cousin has something similar it might explain him being able to see both.

In Topic: Next-Gen OpenGL To Be Shown Off Next Month

10 February 2015 - 06:10 AM

I know, that makes it different enough that it wouldn't be worth it, specially in the case of D3D12, which its supposed to allow for low CPU overhead.

I didn't suggest it would be as fast as running it under proper D3D12. :)

If it worked well enough to be usable it's worth it because it expands the market for D3D12 games, whether that be to Linux/MacOS or old versions of Windows. Of course, versions of the games supporting GLNext would be better.

In Topic: Next-Gen OpenGL To Be Shown Off Next Month

10 February 2015 - 02:24 AM

What if a vendor wanted to expose an API that happens to look exactly like D3D12, but since it depends solely on the driver, the vendor makes it available in all platforms the driver works on? (like OpenGL as you said)

That's what Wine does to provide D3D support - in that case the 'driver' is OpenGL. When/if Wine gets D3D12 support, it will almost certainly use GLNext. There's already WineD3D on Windows.

In Topic: Trying to optimize a mesh in python, but it's WAY too slow :P

28 November 2014 - 05:06 AM

Ah, ok. Well I finally got it working with the help of an octree. I will try using your methon with the hash maps. I was originally using separate lists inside of each octree node, but I might try to use a map instead. I did use a hash map for changing the indices, but I didn't think of adding up the position values X3. I was too afraid that that would result in a collision, which CAN happen if you have a cube shaped mesh with the same values in different coordinate axis (Example: Vertex1(0, 0, 1), Vertex2(1, 0, 0).

Don't worry about calculating a hash - putting it into the map will do that anyway. Just concatenate everything into a string e.g.:

key = pack("ffffffff", x, y, z, nx, ny, nz, u, v)

Your code can then become something like:
vertexCache = {}

// Get a dictionary of unique vertices.
maxIndex = 0
for v in oldVertexList:
   key = pack("ffffffff", v.x, v.y, v.z, v.nx, v.ny, v.nz, v.u, v.v)
   if not key in VertexCache:
      vertexCache[key] = maxIndex
      maxIndex += 1

// Convert it into a list in index order for unpacking and writing out later.
newVertexList = list(repeat(-1,maxIndex))
for (k,v) in iter(vertexCache.items()):
   newVertexList[v] = k

// Create a new index list referring to items in newVertexList
newIndexList = []
for index in oldIndexList:
   v = oldVertexList[index]
   key = pack("ffffffff", v.x, v.y, v.z, v.nx, v.ny, v.nz, v.u, v.v)
   newIndexList.append(vertexCache[key])

PARTNERS