Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 24 Apr 2012
Offline Last Active Jul 13 2014 05:57 PM

Topics I've Started

Rotating Weapon Gradually To Look at Target Point

02 July 2014 - 06:35 PM

I have a weapon mesh, how do I make it rotate GRADUALLY to look at the player (target)?


I want to update pitch, yaw, roll gradually and find out when the rotation is done.

Muzzle Flash Billboard

01 July 2014 - 11:56 PM

When the enemy shoot, the player should see the muzzle flash, which is usually a billboard


However, the player could see his friend firing and he look at the muzzle flash from the side


I want the muzzle flash to look like this if the player is looking at it from the front:

Attached File  front.jpg   69.95KB   2 downloads


and like this if the player is looking from the sides:

Attached File  side.jpg   10.79KB   2 downloads


I think it can be done using Pixel Shader, but I'm not sure how.

Getting Plane Vertices

14 June 2014 - 04:59 AM

I'm trying to draw a plane, I have the plane normal vector and the distance as the following:

struct Plane
         D3DXVECTOR3 Normal;
         float Distance;

How do I get the plane vertices position?

Creating Camera Bounding Frustum From View and Projection Matrix

13 June 2014 - 05:52 PM

How do I create Bounding Frustum from the view and projection matrix?

Most Efficient Way for Lighting in Forward Rendering

13 June 2014 - 05:49 PM

I'm currently using Forward Lighting and trying to do my best to make sure that the FPS game will always render all the lights


1. In Pixel Shader 2.0, I have

DirectionalLight dirLights[maxLights];
PointLight pointLights[maxLights];
SpotLight spotLights[maxLights];

What is the appropriate number for the variable maxLights?


2. Since Forward Lighting is limited to a certain amount of lights, I have been thinking that I could:

- Detect collision between the light and the camera bounding frustum and only render the light if the camera can see it

- Arrange the lights from closest to farthest to the camera and remove any light if it's index is over 'maxLights' variable


What do you think about my idea? What is the most efficient way to work with forward lighting?