Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 06 Feb 2011
Offline Last Active Today, 03:01 AM

Posts I've Made

In Topic: Compiling and using shaders

Yesterday, 04:30 PM

I am not sure what you mean? If just talking about the compiling and loading of a shader.


Pre-compiled shaders:

  1. Creating shaders in VS2013 by adding a new item, Visual C++ -> HLSL then picking the type of shader I want.
  2. These will compile to .cso files
  3. Loading the .cso file into memory
  4. Using ID3D11Device::CreateVertexShader etc. to turn that loaded cso file into one of the shader objects such as ID3D11VertexShader.

Runtime-compiled shaders:

  1. Get/load your shader code
  2. Use D3DCompile or D3DCompile2 to compile the shader to byte code (the same as the .cso file)
  3. Use ID3D11Device::CreateVertexShader etc. to create your shader object.


By global variables I guess you means constants (ID3D11Context::VSSetConstantBuffers etc.)?  In which case the constants for each type of shader exist separately from whatever the current shader is. If you change shaders and have different constants, you need to set them again.


If you are using the effects system, use D3DX11CreateEffectFromMemory instead of the CreateVertexShader etc. I understand that ID3D11XEffectPass will call all the individual ID3D11Context:: set methods automatically, including putting the effects variables back as the GPU's active constants/variables/globals.

In Topic: Current options for dynamic 3D lighting in a dynamic world

Yesterday, 05:15 AM

Well I don't render a voxel scene directly, each region of the scene gets turned into a triangle (currently list) mesh for each surface material present, allthough that does require a lot more draw calls for non-visible triangles than Ive got with say a BSP scene (allthough I have not tried, I assume then further processing my mesh into a BSP or such is not practical, given how long it used to take with Gold Source and Source maps even without the lighting compile step, and rooms designed to be friendly with that step so they didnt fragment into 1000's of pieces).


So would that be basically using the traditional shadow maps possibly with the cascading thing to get higher resolutions near the camera or somthing more advanced than those (I didn't see a name for a lighting method in your post)?


I have done shadow maps before with forward rendering, but lavk of indirect lighting proved to be a big problem, which I had to work around with carefully picked and scene dependent ambient values and fake light sources (e.g. putting a fairly dim point light just inside the window). I have also done just simple pixel or vertex lighting, but that only uses the light source and vertex/pixel normal, so no shadows at all.

In Topic: Anyone Actually Releasing Games Using Assets From Marketplace Models?

31 August 2014 - 05:10 PM

Lots of games now have character editors that do a pretty good job (The Sims, Saints Row The Third, Eve Online, Dragon Age, to name a few Ive very recently used), so I guess there's at least the information needed to implement, if not tools & libraries to do it. Then all you need from any kind of asset store is a good selection of content to choose from in the way of hair models, cloths and accessories. I wouldn't take any character models entirely, and certainly never for any character that isn't just there in the background to populate an area.


As far as generic content goes. a lot of basic textures and props, vehicles, and possibly buildings (although Id make my own key buildings & vehicles given the textures&props) I think is fine if they fit your art style.

In Topic: Current options for dynamic 3D lighting in a dynamic world

31 August 2014 - 04:59 PM

Mimicking Minecraft is in noway my goal here, its just the only solution to this problem I know of, and even that I am finding has a very large list of complexities and problems.


My goals basically are

  • I want to have a day-night cycle, so need to be able to efficiently vary the brightness of sky light (easy enough with any system I can think of)
  • Light must be obstructed ("shadows"). While in open areas and caves/tunnels this is not such an issue, in user created buildings I feel it is important to not have light sources go through walls, floors, etc.
  • I want decent indirect lighting. For example windows, or small openings in the tops of caves should light the general area, Likewise a player placed light should not cast an area into total darkness because of a small obstruction.
  • Areas with no light sources should actually be dark (taken with the above, this makes anything apart from a highly minimal ambient light value problematic, meaning I really do need a way to at least approximate indirect light for an area)
  • The number and density of light sources may be fairly high (since player placed).
  • I would really like to be able to have colored lights.
  • I would really like to have dynamic/moving lights.
  • I want to be able to get approximate lighting values for a location outside of rendering (e.g. for plant growth, and NPC/AI interaction).

The Minecraft solution was the best idea I had at the time or have now, since it gives a reasonable approximation for shadows and indirect lighting. But there is a lot of limitations, so why I am wondering if there are any other options (or at least known solutions to all these limitations)?

  • It is not practical to have full coloured lighting
  • It is not possible to have directional or spot lights, everything is a point, except a special case to let sky light go directly down (but really id like it to have a proper angle based on the time of day).
  • It is not practical to have moving lights because the light "source" is always an entire voxel so such moving lights are not smooth.
  • The maximum "range" of a light is highly limited, e.g. 15m in my case)
  • When dealing with chunks and the need to efficiently update the lighting data without recomputing the whole world, the algorithm is extremely complicated and prone to bugs (e.g. it just occurred to me that even with my conceptual system without any bugs in the implementation, near the border between the voxel grid and "empty space" there will be lighting glitches in certain situations because I am not propagating light through the empty space).
  • Dealing with opaque blocks that are not cubes is also highly problematic (and I believe minecraft has had and still has some issues with half slabs and stairs).

In Topic: unity monthly subscription question?

30 August 2014 - 02:18 PM

Well to go beyond suggesting you work with cheaper licenses or use a different product, the only way you have any chance of getting a cheaper license deal containing the things you want from Unity is to talk to Unity sales and try and strike a deal (such as a revenue share, or a deposit+loan scheme, etc.).