Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Feb 2012
Offline Last Active Mar 08 2013 12:24 PM

Topics I've Started

Constant buffer not working

08 February 2013 - 03:53 PM

I am using a constant buffer to transfer data to my pixel shader

The problem is that the buffer contains 0s in the shader during runtime for x, y, z, and w of the float4 member, regardless of what data is updated to the buffer

Structure definitions are as follows:


// (C++)
struct Buffer
    XMMATRIX mvp_;
    XMFLOAT4 rgba_;
    int usemvp_;

cbuffer Buffer : register( b0 )
    matrix mvp_;
    float4 rgba_;
    int usemvp_;


 Any help is much appreciated

Why is it faster to develop in certain languages over others?

13 September 2012 - 08:27 PM

I see a lot of comments about how writing code in something like C# is faster than C++, and I fail to understand why. This has nothing to do with performance of applications; simply the difference in taking say 3 weeks to develop in a certain language and 6 in another. Also, I am really just concerned with mainstream languages such as C#, C++, VB, Java, Lua, Python, etc.

Is it just about compile time, which seems to be the reason that developing in a scripting language is faster than a compiled one?
Does it have to do with memory management and garbage collection, because it just takes forever to remember to delete your pointers?
Possibly it involves inherent access to libraries or functions such as the printf("") in Python as compared to cout << "" in C++, is that the case?

Basically, I am trying to understand why the general consensus seems to be that writing code in C# (for example) is better than writing code in C++ (for example), but the performance of that running code is worse.

Texture replaced when rendered to

02 May 2012 - 10:18 AM

Hello there,

I have a 2D lighting engine that renders the game scene to the back buffer, renders the lighting map to a texture, and then renders the texture to the back buffer with a blend state
The issue I'm encountering is that every time I make a Draw call when rendering a light to be added to the light map, it completely replaces all data in the texture including its width and height
For example, let's say I make Draw call that will fill the entire light map texture with black, when I make another Draw call to render a light sprite to the texture, the entire texture is replaced by that single sprite and it also resizes as well
There is the possibly that this is not actually what is occurring, but all evidence from a fair amount of testing indicates this

What I'd like to do is render my lighting sprites to my light map texture just like I would render my object sprites to the back buffer, in that each successive Draw call only adds the new sprite on top of whatever else was there and only replaces certain pixels
I do not believe this is a blend state issue because I use the same one for rendering to the back buffer and the light map, and the back buffer rendering works just fine
Please provide an explanation as to what is going on and how to make this process function as I've described


2D lighting through blend states

01 May 2012 - 02:39 PM

Hello there,

I want to create a lighting system for my 2D game using D3D11
Blend states seem like the way to go
The lighting one that I would expect to work would look like this:
SrcBlend = SRC_COLOR (output from pixel shader that shaded the light map, so this would be the light map)
DestBlend = DEST_COLOR (the existing game scene that was rendered and looks completely lit up and normal without this lighting process)
BlendOp = SUBTRACT (subtracts the light map from the existing scene)

Here's my theoretical process:
Render game scene normally
Set the OM's blend state
Draw the lighting map

The theory for the blend and lighting map is that the blend takes the existing rendered scene and subtracts the inverse of the lighting map from it
Lighting would be white on the map, and darkness black
This should result in the RGB values of the already rendered scene (s) going through this equation with the light map (l): s.R - 1 - l.R, s.G - 1 - l.G, s.B - 1 - l.B. A lit pixel would have 0 subtracted from it, leaving it its natural color and a dark pixel would have 1 subtracted from it, leaving it black

My issue is that no matter what I've tried, I cannot configure a blend state that achieves this effect
Is there something I don't understand about the blend state itself or when it is incurred?

Thanks for any help

Which level of programming detail is best?

30 April 2012 - 12:40 PM

Hello there,

I would like to know what level of programming detail is recommended to build a portfolio in that will land a job in the game development industry

Example levels being: hardcore C++ and DirectX; a somewhat more friendly library like SMFL; an engine like Unity; or a mod SDK like Source
The lower levels typically have greater difficulty and grant more control the programmer
While the higher ones typically produce more content at a quicker rate and are more straightforward

Basically, I don't know how much weight is placed on having creative designs executed well compared to having solved programming problems personally and having a greater understanding of how the games run
I'd imagine that an employer would appreciate the time and effort spent in a lower level environment when considering someone for a programming position; but would be more interested in the more finished and content rich products of higher level environments when a design position is involved
Personally, from what I've read and heard about the inner workings of studios, I'd prefer a programming over a design position although I find both quite intriguing in different ways
So, which type of environment should I spend most of my time such that I would have an attractive portfolio in the future, based on this information?