Pages: « 1 2 3
  Print  
Author Topic: Window Alpha and Message Box  (Read 6403 times)
Offline (Unknown gender) TheExDeus
Reply #30 Posted on: February 07, 2014, 10:02:30 AM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
Quote
I am not understanding, where and when do you plan to combine tx and ty? Because if you do it before sending the vertex data to the GPU, it will lose precision during that, but if you wait until it's in the shader to combine then, then no it won't lose precision at that stage. If you do plan to do it CPU side then combine tx and ty using half floats in the addTexture(tx,ty) call before pushing it into the vector, use a union too like color does because only GLES 3.0 offers half floats.
I meant combining them on CPU side before sending just like you do with colors. I just chose my wording incorrectly as of course it would loose precision data type wise, but I wanted to say that it probably won't loose precision because the data isn't that precise. Like "float color = 255.0f; unsigned char color2 = (unsigned char)color;" will not make color2 data loose precision, while of course char is a lot less precise than a float.

Quote
removing 4 float color from the CPU side, did give me a noticeable frame rate difference, 220->250FPS
That is because you packed and made it 4x smaller and reduced memory bandwidth. That I don't oppose - I even suggest trying the same with texture coordinates. That is why I said it does the conversion on GPU, so the data on the bus is still unsigned chars, but when it gets to the GPU it gets converted to float and normalized to 0-1.

Quote
But you won't stop me from macro'ing every color function.
Have fun.
Code: [Select]
SetLayeredWindowAttributes(enigma::hWndParent, 0, (char)alpha*255, LWA_ALPHA);You should probably cast that to unsigned char.

Quote
Yeah that makes it less optimal.
But that is a drop in the ocean in the grand scheme of things. Especially in a function like window_set_alpha which wouldn't even be ran more than once a step. But you can macro what you want. I would probably even use the 0-255 alpha macro, but it's still about compatibility with GM. And while I don't care one bit about it (because I don't use GM at all), others do.
Logged
Offline (Male) Goombert
Reply #31 Posted on: February 07, 2014, 10:09:36 AM

Developer
Location: Cappuccino, CA
Joined: Jan 2013
Posts: 3110

View Profile
Quote from: TheExDeus
I meant combining them on CPU side before sending just like you do with colors. I just chose my wording incorrectly as of course it would loose precision data type wise, but I wanted to say that it probably won't loose precision because the data isn't that precise. Like "float color = 255.0f; unsigned char color2 = (unsigned char)color;" will not make color2 data loose precision, while of course char is a lot less precise than a float.
Ok, I am fine with that if we just do some math and come up with a proof to show that it doesn't.

Quote from: TheExDeus
That is because you packed and made it 4x smaller and reduced memory bandwidth. That I don't oppose - I even suggest trying the same with texture coordinates. That is why I said it does the conversion on GPU, so the data on the bus is still unsigned chars, but when it gets to the GPU it gets converted to float and normalized to 0-1.
Yes, but here is the wierd part, it was tested on a static model, the model wasn't being uploaded every frame, it was uploaded once the very first time it was drawn, and then never uploaded again. So that doesn't make any sense, the performance boost should have been nothing in the case of your argument, it couldn't have affected the dynamic rendering that much it only drew like 3 lines of text with the framerate. So as I said, the interpolation on the GPU with float you speak of, which I know exactly what you mean, should not have given a 30fps boost by doing that, the 30fps boost indicates it was expanding the vertex data into floats every time it rendered, instead of only once at upload. That to me seems like OpenGL is horribly unoptimal, it should do that expansion on the first upload and leave the data that way.

Quote from: TheExDeus
You should probably cast that to unsigned char.
Yeah I see that.

Quote from: TheExDeus
And while I don't care one bit about it (because I don't use GM at all), others do.
Don't worry I know, I am too, we get too many people coming here complaining about stuff being different, which is why I put a lot of effort into compatibility, effort that you would not likely get from Josh, not saying that in a bad way. For instance, GM's new stupid fuck ds accessors, DaSpirit thought they were retarded and so did I and when I said to Josh don't ever bother adding compatibility for that, he said, don't worry I am not.
« Last Edit: February 07, 2014, 10:13:37 AM by Robert B Colton » Logged
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.

Pages: « 1 2 3
  Print