Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 18 Nov 2005
Offline Last Active Today, 05:38 PM

#4960491 Fill distance with quads

Posted by dpadam450 on 18 July 2012 - 08:47 AM

So I calculate distance between previous point and current point, and if its bigger than something I need to add more quads to that distance automatically.

Uh.....call your draw function for the space in between each brush...

You know how to draw quads. You know how to draw multiple quads. It sounds like you can draw a few more....

#4960319 Easy OpenGL Directional Lighting Question

Posted by dpadam450 on 17 July 2012 - 09:53 PM

Wouldn't to the west and up (as per my prior description) be (-1,0,1)


Assuming that for whatever reason I had translated to some arbitrary point, making it the center (say, [x, y, z]), the resulting light would require the light direction to be (x -(-1), y, z - 1) => (x + 1, y, z -1), correct?

A light with w = 0, means it is directional and not effected by translation basically 0*translation is what the math comes out to be. If you want a positional light such as a lamp post then yea something like that.

I'm pretty sure the lights position is normalized if you use GL without shaders. The vector 1,0,1 is bigger than 1,0,0. If you don't know the Pythagorean theorem then thats what it is for.

#4959862 Easy OpenGL Directional Lighting Question

Posted by dpadam450 on 16 July 2012 - 10:23 PM

The direction in regards to lights is the direction pointing to the light. Not the direction the rays are coming.

Unless you have a modified coordinate system, openGL y-axis is up.

#4958822 Detect camera inside wall

Posted by dpadam450 on 13 July 2012 - 09:45 AM

This is a physics problem. You don't need to test every triangle but you can generalize things like say a statue as a box.

#4958052 Seriously don't understand WHY my framebuffer isn't rendering as a te...

Posted by dpadam450 on 11 July 2012 - 09:06 AM

Only thing I saw different from my code was
glFramebufferTexture vs glFramebufferTexture2D is what I use.

#4955103 Help please- Blender to Maya

Posted by dpadam450 on 02 July 2012 - 05:24 PM

Doesn't make a whole lot of sense that you need to learn Maya for an indie place. You can always export your models from blender and import into maya. Your question about learning it is pretty stupid though. What don't you specifically get? Edge loops? Uv-unwrap? Why can't you google those things for maya and read about it. You asked "I know blender so how do I learn maya." You learn maya, blender has nothing to do with it. Its not like someone here wrote a book called Blender to Maya, you just have to read about it and figure out hotkeys.

#4954716 Help! My directional light gets rotated along with my meshes :(

Posted by dpadam450 on 01 July 2012 - 06:39 PM

Oh duh, just re-read it:
float diffuse = max(dot(a_Normal, nSunVector), 0.0);

You have to keep both vectors in the same space. Right now your sun vector is in the world, A_Normal is static/in object space. As the model rotates, you need to take a_normal and multiply it by the model matrix. This keeps it in world space. If you put the view matrix in there as well then the normal is in view space relative to the viewer.

So multiply a_Normal by the model matrix and you are fine, or
multiply a_Normal by the modelviewmatrix and the sun by the view matrix to get them both into view space.

#4953678 Multitexturing and glBindTexture

Posted by dpadam450 on 28 June 2012 - 09:20 AM

We have told you several times, yes what you posted is safe, it is the same thing I posted in a different way. The textures always stay bound. In other words:
The textures always stay bound.

"Can I use them again by activating the texture and not re-binding the texture?"
Yes the textures always stay bound.

#4953468 VBO what does GPU prefers?

Posted by dpadam450 on 27 June 2012 - 03:59 PM

example 2 is still super fast. I've been using it forever and just focused on other things since I don't need to nitpick for optimization yet. example 1 is going to give you some boost for sure. I would think in big scenes it would even be noticeable.

#4953411 Multitexturing and glBindTexture

Posted by dpadam450 on 27 June 2012 - 12:48 PM

Not sure what you mean. You have 8 texture units by default. You can bind any texture you want to any unit, and they remain there for the life of the program no matter what unit is active or if texturing is disabled for that unit. The texture will stay bound even if texturing is disabled.

If you have a model with 3 textures, 2 textures and 1 texture, you can do:
drawModel3(); //again

That what you mean?

#4952382 Texture Transparency Issue

Posted by dpadam450 on 24 June 2012 - 11:51 AM

It is either rendering first and blending with a white background. Or your mip-maps are being downsampled wrong and taking in the transparent pixels as white and blending them in with the actual pixels.

#4952041 3D painting

Posted by dpadam450 on 23 June 2012 - 11:18 AM


Never used it but it lists the feature to do 3D painting.

#4951533 Making glowing objects

Posted by dpadam450 on 21 June 2012 - 04:59 PM

Pretty much looks like a glow texture that has alpha on the edges. Nothing special that it looks like they are doing.

#4950331 High performance texture splatting?

Posted by dpadam450 on 18 June 2012 - 12:37 PM

Also, Why not try just 3 splat channels instead of 4. 3 should be sufficient especially if it is for a small screen embedded device.

#4950066 OpenGL performance question

Posted by dpadam450 on 17 June 2012 - 01:30 PM

I usually do what is simple and optimize if needed later. I have never seen a UI with more than 50 different textures/elements which would be something like starcraft 2. For one, you only need a vbo of a square -.5 to .5 in size and just scale it with a new texture on it. To optimize that a bit, you can use a texture arrray so that you don't have to bind a texture for each image. But even then, just go with the simple solution first.

I think a lot of people think about optimizing the dumbest things. This is negligible at this point. GPU's /CPU's and motherboards are very fast. If you end up making a game that even uses so much power that it dips below 30 or 60 fps (whichever is your goal), then optimize. Until then, just get the game working, you may not need to even optimize once its all done.