|
gra posted:I'm working in DirectX/C++ just now. At the moment, I move things along the x and y axis and rotate them around the z axis - but I want to move the object "forward" along the heading it's been rotated to (I'm thinking asteroids - where the ship moves along the direction it's heading). Any idea/tutorials on how to do this? If you display the ship rotated on screen, you probably have a matrix for that object. Take the rotation part of that matrix (the top left 3x3 part) and rotate the forward vector of the ship with it and push the ship in this direction. The forward vector is the vector in model space that points from the origin of the model space to the nose of the space ship. In most cases the model is aligned along the axes of the model space in which case your forward vector will be something like (0,1,0). So instead of multiplying the vector with the rotation matrix, you can use the respective column directly, in the above case that would be the middle column. heeen fucked around with this message at 22:20 on Dec 2, 2007 |
# ¿ Dec 2, 2007 22:17 |
|
|
# ¿ May 3, 2024 01:52 |
|
OpenGL/GPU question: Can I use different filtering for the same texture in the same Scene? does changing the filtering on a texture require a pipeline flush? As I understand it filtering is done on the TMU, so when I change the filtering on the TMU, this would require all triangles currently in the pipeline for this TMU to be finished first before the new filtering can be applied to new triangles, right?
|
# ¿ Mar 25, 2008 14:55 |
|
Pfhreak posted:heat haze Heat haze is a very simple effect, really. All you need is the current scene in a back buffer, which you perturbate either by using some sine/cosine or whatever function, or you get the distortion by overlaying some textures and using the resulting color as the distortion vector. Additionally you can throw the distance into the mix, to modify the strength of the effect in the distance. I implemented it as a post processing effect, rendering the whole scene into a buffer, then rendering one quad for the whole scene with the heat haze shader applied. GLSL code follows: code:
|
# ¿ Mar 25, 2008 16:56 |
|
What's wrong with this shader? Some vertices seem to move with the camera view. code:
|
# ¿ Apr 11, 2008 19:29 |
|
HB posted:I'm not really familiar with GLSL, but I have a hunch it's reacting badly to in-place editing of inputs. What happens if you copy gl_Position to a temp before messing with it? Came here to post that this worked.
|
# ¿ Apr 11, 2008 22:05 |
|
TSDK posted:Is it actually chewing 100% of your CPU, or is it just being reported as using 100% of CPU by Task Manager. Your engine actually used 100% cpu, its just the premptive scheduler dividing the cpu up on all tasks when you start another one. A task that uses 100% cpu AND is lagging the rest of the system has usually trouble with side effects like swapping to the hard drive or some driver issue. edit: I just remembered: Mr. Dog are you running debug or release builds? debug can easily chew 90% more cpu than release. My little opengl project runs at around 100fps in debug and 1200fps in release which leads to 60% cpu ves 5% cpu when clamped to 60fps. heeen fucked around with this message at 13:20 on Apr 14, 2008 |
# ¿ Apr 14, 2008 13:12 |
|
What is the correct way to compute a depth buffer value from world position, because this gives my slightly wrong values:code:
|
# ¿ Apr 23, 2008 10:50 |
|
Ok, the calculation seems to be correct, yet it seems to be z-culled away, any ideas? I'm raycasting triangles into triangles that lie in front of the former, if that makes sense. Here is what it looked like with my (apparently wrong) depth calculation. You can see the pool bleed into the border. edit: code:
|
# ¿ Apr 23, 2008 20:12 |
|
StickGuy posted:Enjoy. code:
edit alright, I think I found the error in your quote, did you mean to write gl_ModelViewProjectionMatrix? because it seems to work Edit: http://heeen.de/proj/refract.avi http://www.youtube.com/watch?v=hqLobCH8PFo heeen fucked around with this message at 23:48 on Apr 23, 2008 |
# ¿ Apr 23, 2008 22:59 |
|
For my project I need a stencil buffer-only write pass, which is the most efficient way to disable writing to the color buffer, glColormask, glBlendfunc or glDrawbuffer?
|
# ¿ May 5, 2008 17:33 |
|
I'm trying to use glClipPlane here, but no matter what values I send, it doesn't clip anything. If I try a positive and a negative halfspace surely some clipping should be noticable?
|
# ¿ May 14, 2008 23:13 |
|
HB posted:glEnable(GL_CLIP_PLANE0); I have it enabled alright, to no effect. If I try 0,0,1,0 and 0,0,-1,0 or 0,1,0,0 and 0,-1,0,0 as parameters at least one of them should clip something, right?
|
# ¿ May 14, 2008 23:52 |
|
edit: wrong quote you have to use additive blending (gl_one, gl_one) if each light pass already contains the diffuse color of the tiles, or you can first render all lights and multiply it with the diffuse color of your scene afterwards. heeen fucked around with this message at 10:34 on May 15, 2008 |
# ¿ May 15, 2008 10:26 |
|
HB posted:If you set <1,0,0,0> (or <-1,0,0,0>) you should see exactly half of your scene. I found the solution, I have to use gl_ClipVertex in my vertex shader to use clipping planes. I didn't understand the problems with transformations yet, though. seems like I can just use ftransform when my clipping plane is specified in eye coordinates, but other than that, I don't know yet. edit: 8) How does user clipping work? DISCUSSION: The OpenGL Shading Language provides a gl_ClipVertex built-in variable in the vertex shading language. This variable provides a place for vertex shaders to specify a coordinate to be used by the user clipping plane stage. The user must ensure that the clip vertex and user clipping planes are defined in the same coordinate space. Note that this is different than ARB_vertex_program, where user clipping is ignored unless the position invariant option is enabled (where all vertex transformation options are performed by the fixed functionality pipeline). Here are some tips on how to use user clipping in a vertex shader: 1) When using a traditional transform in a vertex shader, compute the eye coordinates and store the result in gl_ClipVertex. 2) If clip planes are enabled with a vertex shader, gl_ClipVertex must be written to, otherwise results will be undefined. 3) When doing object-space clipping, keep in mind that the clip planes are automatically transformed to eye coordinates (see section 2.11 of the GL 1.4 spec). Use an identity modelView matrix to avoid this transformation. heeen fucked around with this message at 18:37 on May 16, 2008 |
# ¿ May 16, 2008 18:24 |
|
Deos someone have some good texture resources? Preferably with normal/spec/bumpmap.
|
# ¿ May 19, 2008 21:45 |
|
Here's a timer class I wrote once:code:
code:
code:
heeen fucked around with this message at 13:54 on May 25, 2008 |
# ¿ May 25, 2008 13:51 |
|
Well, no. I wrote that a few years ago and never thought about it. I had a different class for unix timers, so I didn't really need a virtual function, I just wanted a defined interface.
|
# ¿ May 25, 2008 23:03 |
|
gibbed posted:Havok announced a few months ago that they would be releasing the core library for Havok to the public, looks like they finally got around to it: Excellent I have been waiting for this. Now I wonder wether I should try Havok or PhysX first. Can anyone compare the two?
|
# ¿ Jun 3, 2008 09:48 |
|
I want to convert eye-coordinates into world-coordinates in my geometry shader, but soemthing is a bit off here:code:
edit: nevermind, got it. heeen fucked around with this message at 18:30 on Jun 17, 2008 |
# ¿ Jun 17, 2008 18:06 |
|
Can someone share insights in developing an entity system? As in what properties, how extendable, parent-child relationship, spawning, management etc. Is duck-typing practicable? Or a mixture of static typing and dynamic properties?
|
# ¿ Feb 2, 2009 21:43 |
|
OneEightHundred posted:Are you networking this or making a single-player game? I'm writing the engine in c++ and want to add scripting in js later. For now it is single player only. I think I'm going to use the hybrid method described above: A few fixed entity classes for things like models, lights, physics, plus a script namespace for dynamic properties to avoid the bottleneck mentioned above.
|
# ¿ Feb 3, 2009 03:54 |
|
What do you guys think of the Blender game engine?
|
# ¿ Feb 9, 2009 12:48 |
|
Does Hammer support patches, like Gtkradiant?
|
# ¿ Feb 19, 2009 18:39 |
|
Scene graphs - just say no
|
# ¿ Jan 28, 2010 19:22 |
|
Would anyone be interested in sharing resources like textures and models? I just made a 4096 concrete texture and a 2048 metal floor texture.
|
# ¿ Apr 5, 2010 15:11 |
|
QuakeC is compiled to bytecode or actual binaries you buffoons
|
# ¿ May 3, 2010 20:18 |
|
Chris Awful posted:Is it possible to set the origin in opengl to the topleft part of the screen, and keep it there when resizing the window? You can use gluOrtho2D with the values for top end bottom swapped and you'll have the y-axis flipped.
|
# ¿ Jun 8, 2010 20:39 |
|
|
# ¿ May 3, 2024 01:52 |
|
Ceshire Cat: http://www.pseudoform.org/index.php?id=media went open source, looks like it fits your problem pretty well.
|
# ¿ Jun 25, 2011 09:44 |