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!


cephalo

Member Since 04 Mar 2011
Offline Last Active Yesterday, 08:13 PM

Topics I've Started

Choosing where to generate particles.

27 February 2015 - 03:47 PM

Hi Everyone,

 

I need some ideas on a good way to place particles for a waterfall system. For a single waterfall, the answer is simple. I would choose a random point along a line segment spanning the top of the waterfall, and have the particle start there with the appropriate force vectors etc.

 

Here's the difficult part: There could be quite a few waterfalls on screen at one time, and all of them would have different widths although I can use a finite set of widths (like small, medium, large river). I would like to ensure that there would be a direct relationship between the number of particles on a waterfall and it's width, so that a wide river has more particles spawn there at a given time than a narrow river, but in a way that is visually (mathematically?) proportional and consistent.

 

I've already went down a few rabbit holes trying devise some overall weighted random choice across differing line segments, but that involves looping through everything and is probably not feasible. I would like to hear how other people would handle the problem.


Questions about billboards

24 October 2014 - 08:33 PM

I'm at the point in my project where I have to implement some basic spherical billboards. I have dabbled with billboards in the past and I've never been able to get controllable results, always having things flip backwards or upside down or really just always the opposite of what I was trying to do.

 

I have been googling the problem and it seems like there have been many ways to do it over the years, and I'm wondering how it should be done these days with DX11. Most of the examples I have found use the geometry shader to generate a quad, but whenever I have used geometry shaders, I get massive framerate hits just by having a pass-through geometry shader in my pipline. It seems like it could also be done with the tessellation pipeline instead.

 

Can anyone point me toward some modern hlsl shader code that implements a basic spherical billboard? My grasp of the theory behind it is a bit shaky, so I'm hoping some actual working code will show me what I'm missing.

 

I would also like to implement a particle system in the future, but I need to get billboards down first.


Ugliness on different hardware (solved)

27 June 2014 - 09:46 PM

I'm trying a project I've been working on on a different computer than I usually use, and I'm getting extreme artifacts on this machine.

 

My usual computer is an older Windows 7 computer with a really bad, built in Intel vid card. My application works exactly like it is supposed to on that machine. I'm not doing anything out of the ordinary with my shaders, they are very simple solid color outputs and simple vertex adjustments. I haven't yet checked the reference device on that machine because I haven't had any problems.

 

This new machine is a Windows 8 machine with a much better NVidia vid card, however, in the screenshot you can see that certain parts of the screen are garbled and mixed together. They flash like crazy when the camera moves. This same problem is also evident when I use the reference device. I have ruled out problems with my texture generation by disabling the sampling in the pixel shader. The problem exists even when I don't use textures.

 

Attached File  HexDemoProblem.jpg   224.51KB   1 downloads

 

How should I go about solving this problem?

 

EDIT: Also, I forgot to mention I'm using SharpDX and VS2012 Express.


Question about depth bias.

23 June 2014 - 09:16 AM

I recently used the depth bias field in the rasterizer state description to get rid of some z-fighting issues that I had. I drew some stuff, then changed the rasterizer state to a depth bias of -10, then drew other stuff. This eliminated any z fighting perfectly.

 

I have a question though. My next step will involving some more co-planer drawing, and I could simplify some things if I could allow these quads to overlap in places. Does the depth bias apply only to reads of the depth buffer? I'm not sure how to formulate this question... let me express what I want to do.

 

Can I, in the same draw call of many, possibly overlapping instanced quads, ensure that whatever is drawn after, or before, always wins the depth test? I just need one quad or the other to always win. It could be those drawn first or those drawn last. I'm unsure of exactly how the depth bias works.


Animation timing. (SharpDX)

04 June 2014 - 09:09 AM

Ok, I am doing a project using SharpDX that has evolved over time from XNA, to SlimDX and now SharpDX. For my FPS counter, I have been using the System.DateTime.Now.Ticks property to get a measure of time passed. I can't remember when I first implemented my FPS counter, but it always seemed to work. When performance was low I got low numbers and when performance was high I got high numbers.

 

Recently I have been trying to use the same mechanism to do some color animation, and it is painfully obvious that the System.DateTime class updates itself in a very sporadic way that is not suitable for animation. For example, it seems to give accurate measures of time, but frequently stops for half seconds at a time, more or less.

 

Where can I get a better measure of time so I can do animations and other camera control movements that are de-coupled from my framerate?


PARTNERS