Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 11 Sep 2009
Offline Last Active Apr 24 2016 11:35 AM

Topics I've Started

Adding some type of metadata in HLSL?

27 August 2015 - 04:08 AM

I am using the D3D shader reflection function to generate my vertex input layout, however I need to specify whether a variable is per-vertex or per-instance and as far as I know there is no official HLSL way to do this.


I thought about adding my own metadata structure at the top of the file, parse it and pass the rest of the shader to D3DCompile (instead of D3DCompileFromFile). Does this sound like a good idea? What is the generally used approach?

Finding Up and Right vectors from Look for view matrix?

26 August 2015 - 06:29 AM

I want to be able to set the direction the camera is facing but I can't figure out how to determine the other vectors from the view direction.

Design pattern for linking UI events to editor code?

27 July 2015 - 05:50 AM

When I started writing my terrain editor, I had few UI events so I just had their IDs stored in an enum and called a function to process the event in my editor whenever the event occured. As the number and type of events grew, the code became messy. Basically a giant nested switch statement.


What would be a good way to handle this situation? I have various event types such as:

- Setting parameters (floats, integers, bools, strings, etc..)

- Changing render modes / view modes / paint modes

- 'Orders' such as new, load, save, etc...


And then there is of course the fact that this has to be general enough to be integrated with an Undo/Redo system.

Is there a reason why you cannot see the values of 1- and 2-letter variables in VS grap...

24 July 2015 - 11:55 PM

Just curious. My shader had some of these variables and I wasn't able to read their values and when adding them to a watch list they had an invalid expression for a value. Giving them a longer name worked. But why?

Why use texture splatting?

06 July 2015 - 09:57 AM

Is there any particular reason why texture splatting is a thing?


The reason I'm asking is because in texture splatting you have to load an alpha map (4 channels for 4 splats per terrain tile), sample the splat textures in the shaders and then blend them. Then of course there is the cost of setting texture atlases or texture arrays.


On the other hand, if you just have a single RGB texture per terrain chunk that is painted in your terrain editor, you just have to load it and sample it and you're done...


Is there something I am missing?


As a side question, if you are using texture splatting and a texture array, is there a workaround the fact that all texture splats must be the same size?