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!


Member Since 06 Oct 2006
Offline Last Active Today, 03:22 AM

#5219698 Logo Feedback

Posted by phil_t on Yesterday, 02:09 PM

It looks pretty, but the bulk of the image doesn't really seem to convey any meaning. Like Josh said, only the small bit with the eyes looks like an animal, and it seems kind of "neglected", or "out on the edge". My focus is drawn to the swirly things in the middle, but they don't convey any meaning to me.


edit: oh, is the swirl in the middle supposed to be a "G" for games?

#5219635 cross shader

Posted by phil_t on Yesterday, 09:46 AM

One alternate way is to just have a pre-crossed star texture and draw it multiple times at different locations over the already rotated background. But with 1000 stars I'm afraid it's not going to be very economical.


Why not?


The shader would probably be something like the simple blur shader. I'm saying this because I guess it should "smudge" the points (original stars) upwards, downwards, left and right.


Blur shaders are generally a lot more costly than a shader that just draws from a texture, since each pixel needs to take multiple texture samples. I don't see how this is cheaper than your first option, you still have the same amount of geometry (probably a quad for each star), and are drawing the same number of pixels. Unless I'm understanding your meaning incorrectly?


And I want to take advantage of the shader parallelism.


All shaders take advantage of "shader paralellism".



It sounds like your stars should just be billboards. They have a 3d presence in your world, but are actually just billboards that are drawn to always face the camera view plane. Search for "billboarding". Most particle effect shaders also do this - particles are just textured quads that face the camera view plane.

#5219463 Win 7 crash without error message

Posted by phil_t on 26 March 2015 - 04:18 PM

You can ask windows to attach a debugger after a crash. See "Configuring Automatic Debugging for Application Crashes" here:





Or maybe just start your game under the debugger in release mode?

#5219213 Particle Z Fighting

Posted by phil_t on 25 March 2015 - 09:01 PM

Yeah, given the way your particles look (sharp transitions from full alpha to 0 alpha), I was gonna suggest using alpha testing instead of alpha blending.

#5218605 Particle Z Fighting

Posted by phil_t on 23 March 2015 - 03:13 PM

Then again, sometimes perfectionism is a programmers worst enemy and maybe it really doesn't look that bad for what I'm trying to do.


Perhaps... Honestly, the only flashing I could see was the flame symbols (which I assume was intentional). I can't tell anything is wrong with the waterfalls (maybe because the camera was never stationary).


Looks very nice!

#5218512 c++ count lines in txt file and then read these lines without reopening a file

Posted by phil_t on 23 March 2015 - 11:18 AM

Cross-platform memory mapped file:



(No claims as to the correctness, etc..., just found this on a google search).

#5218505 Particle Z Fighting

Posted by phil_t on 23 March 2015 - 11:08 AM

Are the particles z-fighting with the wall behind the waterfall? If so, just don't place them on the exact same plane as the wall.


Or are the particles "z-fighting" with themselves? That's not really possible if you're not writing the particles to the depth buffer. Like Syntac_ says, show us a picture. Z-fighting would typically manifest itself by parts of the particle quad being in front of another and parts behind (which shouldn't be possible in your scenario, unless you're using some other test in your pixel shader to discard certain pixels).


If instead what you are actually seeing is an particle quad being drawn in front of another in one frame, then behind in another frame, then it just means you aren't keeping a consistent drawing order.

#5218085 Open World games in Unity game engine?

Posted by phil_t on 21 March 2015 - 11:24 AM

we both probably know that open world games have existed long before your computer was produced.


Yup. Here's an open world game. Bet it wouldn't "lag" if implemented in Unity.



#5217691 Data structure with bool field. How to set correctly?

Posted by phil_t on 19 March 2015 - 12:47 PM

According to this thread:



A bool is 4 bytes in HLSL. So try replacing your bool in PixelData with a BOOL.

#5215298 Efficient way to generate normal map (from height) for all 360 degrees of a r...

Posted by phil_t on 08 March 2015 - 02:26 PM

Given the normal that you unpack from the normalmap, I think all you need to do is transform that normal by a matrix that specifies a rotation about the z-axis by the number of degrees you need.

#5215032 Texture atlas generator

Posted by phil_t on 06 March 2015 - 04:04 PM

Do you have any idea what that entails? 64 unwrappings requires 64 specific start-end coordinates and the 64 manual wrapping calculations associated with each.


Not sure I understand this. There a single set of texture coordinates that need to be "adjusted" in the pixel shader.


The OP's problem is solved by using a texture atlas with some wrapped border region included around each image in the atlas.


You never identified texture filtering as your main problem, and instead blamed texture wrapping.
If you’re already comparing your solution to an existing one’s, the bleeding is not caused by wrapping (it would be though), it is caused by bilinear-filtering.


... which is solved by having a border region surrounding the atlas image...

#5214994 C# Variable binding

Posted by phil_t on 06 March 2015 - 12:49 PM

Like Josh said, it sounds like you want a dictionary of string -> (object, FieldInfo) pairs   (or (object, PropertyInfo)).


Using the object and the FieldInfo, you can get the value of that field on a particular object.


Use the reflection APIs to get the FieldInfo for an object.


Type type = objectThatHasFred.GetType();

FieldInfo fieldInfo = type.GetField("Fred");

// Then store "Fred" -> (objectThatHasFriend, fieldInfo) in your dictionary.

#5214377 What physical phenomenon does ambient occlusion approximate?

Posted by phil_t on 03 March 2015 - 11:54 PM

I'm simply wondering how to keep the contribution physically correct and variable depending on the environment.


I'm not sure it's realistic to make things like the sky brightness physically correct. Clouds might give off more light than a clear blue sky, but it's going to depend on so many factors. Probably more practical to just have some artistic control that is modulated by the overall sunlight.


For the "ground" part of your sky dome, the amount of light given off can be calculated assuming you know the approximate albedo of the ground and the amount of light coming from the sun or top half of the sky dome.


I did some experiments to try to improve my ambient lighting which may be of interest:


#5214369 Game Perfomance

Posted by phil_t on 03 March 2015 - 11:20 PM

Some links for you:


To gain a decent understanding of what might impact graphics performance, read and understand this thoroughly: 

"too many textures would slow the perfomance, but not as much as too many triangles in the scene" (something like that)
No one will be able to make any general claims like that. It will depend on your situation. Sometimes vertex processing will be your bottleneck, sometimes (more commonly? though I hesitate to say anything like that) texture bandwidth will be your bottleneck. Sometimes something else will be.
And of course, your bottleneck might be on the CPU, not be the GPU.
So yeah, you can't really answer this question generally:

what are all those "things" that slow the perfomance?
Like Nypyren, said, "everything". You can only answer "what are all those things that are taking the longest in this particular game in this particular frame" (using a profiler).

#5213795 Dynamic Memory and throwing Exceptions

Posted by phil_t on 01 March 2015 - 08:40 PM

whereas smart_ptr specifies an unknown number of owners.


What's smart_ptr? Do you mean shared_ptr?



To the O.P.: As others have said, use vector. Possibly unique_ptr<int[]> is another option, if the semantics of unique_ptr fit your usage scenario.


Also, this is essential reading if you are allocating memory or acquiring any unmanaged resources (file handles, critical sections, etc...) in an environment where exceptions can be thrown: