• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

6 Neutral

1 Follower

About CortexDragon

  • Rank

Personal Information

  • Industry Role
  • Interests
  1. 2D Is there a working resolution...?

    My monitor is 1920 x 1200
  2. I am a bit unclear what you are trying to do. You can do 2 totally seperate things with directx2d in your directx3d program. 1. You can use directx2d to write to the swapchain backbuffer. 2. You can use direct2d to write to a texturebuffer that you use as a SRV in your 3d pipeline. This has nothing to do with the swapchain. For example you might want your pixel shader to use this texture to display some text on the side of an object. See here for different things you can do - https://msdn.microsoft.com/en-gb/library/windows/desktop/dd370966(v=vs.85).aspx
  3. The purpose of the depth offset (called bias in your code) is to prevent objects causing themselves to be in shadow due (which you can see if you set it to zero) So try reducing it slightly maybe half it to .0005f That should move the shadows slightly closer to the object, but if you reduce it too far it may cause self shadows in which case you would have to increase it slightly maybe to .0008f Play around with its value to make it look right
  4. I am able to copy to the backbuffer (I used CopyResource not CopyTextureRegion, but I doubt that is the problem) Remember to switch your backbuffer to D3D12_RESOURCE_STATE_COPY_DEST before copying to it What happens if you resize the window not by switching to fullscreen but instead by dragging the edge of the window bigger ? (assuming you call your resize swapchain code here as well) The problem may be something you have missed when resizing (for eample if you were using a pixel shader you have to recreate rendertargetviews when you resize the swapchain as the old texture buffers dont exist anymore so pointers to them are garbage) The same applies to your uav on the texture your compute shader is writing to if you have recreated that texture on a resize.
  5. 3D Character Creating

    In my opinion Daz makes the best looking character models - but its important to realise its not free if you want to use their models in most types of game. The prices are good for their quality, but they are not free. (if you want free use either makehuman or Manuel Bastoni, or maybe Morph3d I dont know much about it). Daz models have 2 different licence types, a "standard licence" which is just for 2d renders (daz was not originally written for games, its real purpose is to make 2d renders), and an "interactive licence" which is needed to buy a model for most games usages apart from visual novels or sprites. example- You download daz studio (which is free) and it gives you "genesis 8 starter essentials" for free (which includes the basic genesis 8 male and female models under the "standard licence"). You morph those models and export them as people models for your games. As you used "genesis 8 starter essentials" models inside your models in a game, you will need to buy the "interactive licence" for "genesis 8 starter essentials", (which is $100 https://www.daz3d.com/genesis-8-starter-essentials ) I actually prefer genesis 3 instead of genesis 8. (See Appearance tip below.) Similarily each product you buy from their shop also has an optional "interactive licence" which you would need to buy if you want to use it in a game. If a model doesnt have an interactive licence then you cannot legally use it in that way. This is another advantage of daz models - there is a huge amount of clothing models you can buy that fit the characters. Money saving tip - bundles are cheaper as they have an interactive licence that covers everything in their bundle. Appearance tip - If you want figures for the player character, I prefer genesis 3 (ie generation 7) rather than genesis 8. Genesis 8 is very new and doesnt have many good character models under the age of 30 out yet compared to previous versions. So currently I prefer the previous generation of character models ie their generation 7 models which are based on "genesis 3 starter essentials" (which was free in their older download, but i dont know if it is now)
  6. When you created your descriptor heap how many records did you give it ?
  7. HLSL Geometry Shader issue

    Maybe it just needs the standard hlsl packing rules. So your structure would have to be a multiple of float4 in size, and each inbuilt structure bigger than a float or int should start on a float4 size boundry. (although uint2 or float2 might be okay on a float2 sized boundry ?)
  8. I dont think there is a "right" way to do it, just do what is most convenient for you. If you have a large number of textures, a texture array (which is different from an array of textures) is good as it means your hlsl code can easily access whichever texture it wants by using a texture number. But thats really only useful if you have lots of textures, far more than 4. Texturearrays also have the restriction that each texture in that array must have the same x and y dimensions. (you would have to have a different texture array object for each different texture size, but you can obviously have an array of them to do this) To make a texturearray - in your D3D11_TEXTURE2D_DESC object, set textureDesc.ArraySize to be the number of textures. To make your srv you use D3D11_SRV_DIMENSION_TEXTURE2DARRAY instead of D3D11_SRV_DIMENSION_TEXTURE2D ie srvDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DARRAY; srvDesc.Texture2DArray.MostDetailedMip = 0; srvDesc.Texture2DArray.MipLevels = desc.MipLevels; srvDesc.Texture2DArray.FirstArraySlice = 0; srvDesc.Texture2DArray.ArraySize = texturearrayelements; // number of texture array elements In the hlsl you would use Texture2DArray instead of Texture2D. Also remember its a single object not an array of objects when you define its slot in hlsl. When copying into a texture array you do it by the subresources. So the texture array is layed out by having a subresource for each mip of the 1st texture, then a subresource for each mip of the second texture etc.
  9. A good way to avoid extermination in RTS?

    In rome total war, troops have a morale rating which causes troops to run away so battles dont often lead to a total anihalation. They run away when they have taken too many loses in a short period of time. Getting surrounded also lowers moral so some can break while others on the side are still okay. Seeing nearby friendly units die or running can also effect moral. Being near the general increases moral as does him blowing his horn.
  10. The "world" part of a WorldViewProj describes the objects position, rotation and size. To make different objects not be all in the same place, instead of a single gWorldViewProj in the shaders, you would need a seperate "world" for each object (or a seperate gWorldViewProj if you wish to do the combining of world,view,projection in the cpu like you are at the moment) You could either have an array of them inside a constantbuffer, or have a structurebuffer. If you are using executeindirect you dont need an array of them as seen by the vertexshader as you can use it to change the start of your constant buffer view to a different piece of data in a single larger buffer which is an array of all of them. Your vertex could store its objectnumber so it can choose the correct array element in the vertexshader, but thats not ideal if you wanted to draw multiple of the same object in different positions in the world. As this is DX12 you could solve the problem of transmitting the objectnumber to the gpu without imbedding it in a vertex by using a executeindirect instead of a drawindexed as it is tailor made to draw multiple different objects in a single draw Executeindirect can change values in the rootsignature with each draw it issues so it could either be used to pass the objectnumber as a rootconstant or even better can change a single gWorldViewProj constantbufferview and not need an array in the vertexshader and this would be faster. See the D3D12ExecuteIndirect sample https://msdn.microsoft.com/en-us/library/windows/desktop/mt186624(v=vs.85).aspx That sample does this very thing by having a different position for each object by changing the constantbufferview to start at a different element in a bigger buffer which is basically an array of them.
  11. Did your change in LightShaderClass.cpp fix the problem ? (you have a comment about it)
  12. Texture compression / DDS files

    Do the higher BC modes like BC7 render faster in the gpu than the lower equivalent modes like BC3 ? The documentation seems to imply it, but I haven't timed it.
  13. Dynamic world framework

    Skyrim has a radiant AI. Their npcs have factions which like each other and other factions which hate each other so you can get "emergent behavoir" happening For example their are some totally unscripted mods ("Populated lands road paths" and "immersive patrols") that all they do is spawn npcs and set them walking along roads to certain map points across the map. Due to the faction preferences these npcs may decide to attack bandit camps they walk by and other npcs will then get involved if they see their friends being attacked. Big battles occur when stormcloaks and imperials meet. Bandits attack merchants and their body guards help defend them and may wipe out the bandits. All of these events are totally unscripted. Skyrim also has something called radiant quests. These are repeatable quests that randomly pick who is involved and what location it occurs. For example a rescue kidnapped person radiant quest can randomly decide any town or village npc has been kidnapped, and place them in a random place with enemies for you to rescue.
  14. Texture compression / DDS files

    You can compress to BC3 quite fast, but in my experience compressing to BC7 is extremely slow, although I haven't tried the compute shader texture compression functions from directxTex/directXTK so maybe they are faster. So its possible those developers are using BC7 ? Block compression modes - https://msdn.microsoft.com/en-us/library/windows/desktop/hh308955(v=vs.85).aspx
  15. Thankyou everyone - the FXC.exe worked perfectly to make the assembly code. Previously I had just been using the D3DCompileFromFile function to compile my hlsl.
  • Advertisement