Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

112 Neutral

About Vivid3DDev

  • Rank

Personal Information


  • Twitter
  • Github
  • Twitch
  • Steam

Recent Profile Visitors

1913 profile views
  1. Hi, I am a coder too, and also doing well at learning modelling in Blender3D. I have years of C++/C# experience, and also a lot of OpenGL/DX/Vulkan experience. I think the idea of making such a game with doom 3 is a great idea, and would love to help. I can show you examples of my work if needed. I would be happy to help with both coding/3d models.(More a coder) You may contact me at antonyrobwells@gmail.com if you wish.
  2. yes I can get that to work, or I can get a demo to work with constant buffers, but when i combine them is the problem, as no tutorial i've found does so, and my attempts failed. thanks for the link though.
  3. Or if no one knows, can you point me to any DX12 tutorials you know? Preferably c# but any other language is ok. Specifically, ones that cover both constant buffers and textures at the same time?
  4. Hi, I am coding a DirectX12 engine using SharpDX in C#. I have it all working, but once I add a texture to the quad, I get a error message. I can't see any mistakes in the code. Here is the relevant code. If I comment out the texture heap part it runs fine, a colored quad, but if I uncomment it, then it crashes at CommandQueue.close(), saying there is an incorrect parameter. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using GraphicsPlatform; using SharpDX; using SharpDX.Direct3D12; using SharpDX.DXGI; using DX12Plat.DataTypes; using System.Runtime.InteropServices; namespace DX12Plat { public class DX12Platform : GraphicsPlatform.GraphicsPlatform { public D3DApp D3D = null; private int _wW, _wH; public static DX12Platform ThisPlatform = null; public override void InitWindow(string title, int width, int height, bool fullscreen) { ThisPlatform = this; _wW = width; _wH = height; D3D = new D3DApp(); D3D.SetMetrics(width, height, title, false); D3D.Initialize(); D3D.CommandList.Reset(D3D.DirectCmdListAlloc, null); BuildRectHeap(); BuildRectConstantBuffers(); BuildRectRootSignature(); BuildRectShadersAndInputLayout(); // BuildRectGeo(20, 20, 200, 200); RectBuildPSO(); D3D.CommandList.Close(); D3D.CommandQueue.ExecuteCommandList(D3D.CommandList); D3D.FlushCommandQueue(); base.InitWindow(title, width, height, fullscreen); } // - 2D drawing props. private RootSignature _RectrootSignature; private DescriptorHeap _cbvHeap; private DescriptorHeap[] _descriptorHeaps; private UploadBuffer<DataTypes.ObjectConstant2D> _RectobjectCB; private ShaderBytecode _rectVSByteCode; private ShaderBytecode _mrectPSByteCode; private InputLayoutDescription _inputLayout; private PipelineState _RectPSO; private Matrix _proj = Matrix.Identity; private Matrix _view = Matrix.Identity; private float _theta = 1.5f * MathUtil.Pi; private float _phi = MathUtil.PiOverFour; private float _radius = 5.0f; private Point _lastMousePos; private DescriptorHeap _tvHeap; public void BuildRectHeap() { var cbvHeapDesc = new DescriptorHeapDescription { DescriptorCount = 1, Type = DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView, Flags = DescriptorHeapFlags.ShaderVisible, NodeMask = 0 }; var svHeapDesc = new DescriptorHeapDescription { DescriptorCount = 1, Type = DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView, Flags = DescriptorHeapFlags.ShaderVisible, NodeMask = 0 }; _cbvHeap = D3D.Device.CreateDescriptorHeap(cbvHeapDesc); _tvHeap = D3D.Device.CreateDescriptorHeap(svHeapDesc); } private void BuildRectConstantBuffers() { int sizeInBytes = D3DUtil.CalcConstantBufferByteSize<DataTypes.ObjectConstant2D>(); _RectobjectCB = new UploadBuffer<DataTypes.ObjectConstant2D>(D3D.Device, 1, true); var cbvDesc = new ConstantBufferViewDescription { BufferLocation = _RectobjectCB.Resource.GPUVirtualAddress, SizeInBytes = sizeInBytes }; CpuDescriptorHandle cbvHeapHandle = _cbvHeap.CPUDescriptorHandleForHeapStart; D3D.Device.CreateConstantBufferView(cbvDesc, cbvHeapHandle); } private void BuildRectRootSignature() { // Shader programs typically require resources as input (constant buffers, // textures, samplers). The root signature defines the resources the shader // programs expect. If we think of the shader programs as a function, and // the input resources as function parameters, then the root signature can be // thought of as defining the function signature. // Root parameter can be a table, root descriptor or root constants. // Create a single descriptor table of CBVs. var cbvTable = new DescriptorRange(DescriptorRangeType.ConstantBufferView, 1, 0); var svTable = new DescriptorRange { RangeType = DescriptorRangeType.ShaderResourceView, DescriptorCount = 1, // OffsetInDescriptorsFromTableStart = int.MinValue, BaseShaderRegister = 0 }; // A root signature is an array of root parameters. var rootSigDesc = new RootSignatureDescription(RootSignatureFlags.AllowInputAssemblerInputLayout, new[] { new RootParameter(ShaderVisibility.Vertex,cbvTable), new RootParameter(ShaderVisibility.Pixel,svTable) }, new[] { new StaticSamplerDescription(ShaderVisibility.Pixel,0,0) { Filter = Filter.MinimumMinMagMipPoint, AddressUVW = TextureAddressMode.Border } } ) ; _RectrootSignature = D3D.Device.CreateRootSignature(rootSigDesc.Serialize()); } private void BuildRectShadersAndInputLayout() { _rectVSByteCode = D3DUtil.CompileShader("data/platform/dx12/shader/rect2d.hlsl", "VS", "vs_5_0"); _mrectPSByteCode = D3DUtil.CompileShader("data/platform/dx12/shader/rect2d.hlsl", "PS", "ps_5_0"); _inputLayout = new InputLayoutDescription(new[] // TODO: API suggestion: Add params overload { new InputElement("POSITION", 0, Format.R32G32B32_Float, 0, 0), new InputElement("COLOR", 0, Format.R32G32B32A32_Float, 12, 0), new InputElement("TEXCOORD",0,Format.R32G32B32A32_Float,28,0) }); } private MeshGeometry _RectGeo; private long GetRequiredIntermediateSize(SharpDX.Direct3D12.Resource destinationResource, int firstSubresource, int NumSubresources) { var desc = destinationResource.Description; long requiredSize; D3D.Device.GetCopyableFootprints(ref desc, firstSubresource, NumSubresources, 0, null, null, null, out requiredSize); return requiredSize; } public override Texture2D LoadTexture2D(string path) { System.Drawing.Bitmap bits = new System.Drawing.Bitmap(path); int w = bits.Width; int h = bits.Height; byte[] pix = new byte[w * h * 4]; int loc = 0; for(int y = 0; y < h; y++) { for(int x = 0; x < w; x++) { var col = bits.GetPixel(x, y); pix[loc++] = col.R; pix[loc++] = col.G; pix[loc++] = col.B; pix[loc++] = col.A; } } return CreateTexture2D(w, h, pix); } public Texture2D CreateTexture2D(int w, int h,byte[] data) { D3D.DirectCmdListAlloc.Reset(); D3D.CommandList.Reset(D3D.DirectCmdListAlloc,null); var tex = new Texture2DDX12(); var textureDesc = ResourceDescription.Texture2D(Format.R8G8B8A8_UNorm, w, h); SharpDX.Direct3D12.Resource texture = D3D.Device.CreateCommittedResource(new HeapProperties(HeapType.Default), HeapFlags.None, textureDesc, ResourceStates.CopyDestination); tex.texture = texture; tex.textureDesc = textureDesc; tex.Width = w; tex.Height = h; long uploadSize = GetRequiredIntermediateSize(texture, 0, 1); var textureUploadHeap = D3D.Device.CreateCommittedResource(new HeapProperties(CpuPageProperty.WriteBack, MemoryPool.L0), HeapFlags.None, ResourceDescription.Texture2D(Format.R8G8B8A8_UNorm,w,h), ResourceStates.GenericRead); var handle = GCHandle.Alloc(data, GCHandleType.Pinned); var ptr = Marshal.UnsafeAddrOfPinnedArrayElement(data, 0); textureUploadHeap.WriteToSubresource(0, null, ptr, 4 * w, data.Length); handle.Free(); D3D.CommandList.CopyTextureRegion(new TextureCopyLocation(texture, 0), 0, 0, 0, new TextureCopyLocation(textureUploadHeap, 0), null); D3D.CommandList.ResourceBarrierTransition(texture, ResourceStates.CopyDestination, ResourceStates.PixelShaderResource); var srvDesc = new ShaderResourceViewDescription { Shader4ComponentMapping = D3DXUtilities.DefaultComponentMapping(), Format = textureDesc.Format, Dimension = ShaderResourceViewDimension.Texture2D, }; srvDesc.Texture2D.MipLevels = 1; D3D.Device.CreateShaderResourceView(texture, srvDesc, _tvHeap.CPUDescriptorHandleForHeapStart); D3D.CommandList.Close(); D3D.CommandQueue.ExecuteCommandList(D3D.CommandList); D3D.FlushCommandQueue(); return tex; } private void RectBuildPSO() { var psoDesc = new GraphicsPipelineStateDescription { InputLayout = _inputLayout, RootSignature = _RectrootSignature, VertexShader = _rectVSByteCode, PixelShader = _mrectPSByteCode, RasterizerState = RasterizerStateDescription.Default(), BlendState = BlendStateDescription.Default(), DepthStencilState = DepthStencilStateDescription.Default(), SampleMask = int.MaxValue, PrimitiveTopologyType = PrimitiveTopologyType.Triangle, RenderTargetCount = 1, SampleDescription = new SampleDescription(D3D.MsaaCount, D3D.MsaaQuality), DepthStencilFormat = D3D.DepthStencilFormat, StreamOutput = new StreamOutputDescription(), Flags = PipelineStateFlags.None }; psoDesc.RenderTargetFormats[0] = D3D.BackBufferFormat; _RectPSO = D3D.Device.CreateGraphicsPipelineState(psoDesc); } public override void BeginRun() { D3D.BeginRun(); } public override void UpdateRun() { D3D.UpdateRun(); } public override void BeginFrame() { //D3D.BeginFrame(); } public override void Present() { // Indicate a state transition on the resource usage. D3D.CommandList.ResourceBarrierTransition(D3D.CurrentBackBuffer, ResourceStates.RenderTarget, ResourceStates.Present); // Done recording commands. D3D.CommandList.Close(); // Add the command list to the queue for execution. D3D.CommandQueue.ExecuteCommandList(D3D.CommandList); // Present the buffer to the screen. Presenting will automatically swap the back and front buffers. D3D.SwapChain.Present(0, PresentFlags.None); // Wait until frame commands are complete. This waiting is inefficient and is // done for simplicity. Later we will show how to organize our rendering code // so we do not have to wait per frame. D3D.FlushCommandQueue(); } public List<DXRect> Rects = new List<DXRect>(); private float drawZ = 0.01f; public override void BeginDrawing() { Rects.Clear(); drawZ = 0.99f; } public override void EndDrawing() { _proj = Matrix.OrthoLH(_wW, -_wH, 0, 1); //_proj = Matrix.Identity; var cb = new DataTypes.ObjectConstant2D { Proj = _proj }; _RectobjectCB.CopyData(0, ref cb); D3D.BeginRender(_RectPSO); _descriptorHeaps = new DescriptorHeap[2]; _descriptorHeaps[0] = _cbvHeap; _descriptorHeaps[1] = _tvHeap; // TODO: Make requiring explicit length optional. D3D.CommandList.SetDescriptorHeaps(_descriptorHeaps.Length, _descriptorHeaps); D3D.CommandList.SetGraphicsRootSignature(_RectrootSignature); D3D.CommandList.SetGraphicsRootDescriptorTable(1, _cbvHeap.GPUDescriptorHandleForHeapStart); D3D.CommandList.SetGraphicsRootDescriptorTable(0, _tvHeap.GPUDescriptorHandleForHeapStart); D3D.CommandList.PrimitiveTopology = SharpDX.Direct3D.PrimitiveTopology.TriangleList; foreach (var rect in Rects) { D3D.CommandList.SetVertexBuffer(0, rect._Geo.VertexBufferView); D3D.CommandList.SetIndexBuffer(rect._Geo.IndexBufferView); D3D.CommandList.DrawIndexedInstanced(rect._Geo.IndexCount, 1, 0, 0, 0); } } float xi = -0.5f; bool first = true; public override void DrawRect(int x, int y, int w, int h, float r, float g, float b, float a,Texture2D tex) { // x = x - _wW / 2; x = x - _wW / 2; y = y - _wH / 2; xi = xi + 0.001f; DXRect rect = new DXRect(D3D, x, y, w, h, r, g, b, a, drawZ, tex as Texture2DDX12); //rect.DrawZ = drawZ; drawZ -= 0.001f; Rects.Add(rect); // _proj = Matrix.OrthoOffCenterLH(_wW,0, _wH,0, 0, 1); } } public class D3DXUtilities { public const int ComponentMappingMask = 0x7; public const int ComponentMappingShift = 3; public const int ComponentMappingAlwaysSetBitAvoidingZeromemMistakes = (1 << (ComponentMappingShift * 4)); public static int ComponentMapping(int src0, int src1, int src2, int src3) { return ((((src0) & ComponentMappingMask) | (((src1) & ComponentMappingMask) << ComponentMappingShift) | (((src2) & ComponentMappingMask) << (ComponentMappingShift * 2)) | (((src3) & ComponentMappingMask) << (ComponentMappingShift * 3)) | ComponentMappingAlwaysSetBitAvoidingZeromemMistakes)); } public static int DefaultComponentMapping() { return ComponentMapping(0, 1, 2, 3); } public static int ComponentMapping(int ComponentToExtract, int Mapping) { return ((Mapping >> (ComponentMappingShift * ComponentToExtract) & ComponentMappingMask)); } } }
  5. Vivid3DDev

    Looking for Project/Team

    Hi, I am part of a team of ten people working on a game in Unity3D - The game is an adventure/rpg game, called "Destiny Of A Starlit Empire" - it's gong to be episodic game, each ep around 3 hours of gameplay. We have our own website and forums, and the project is on github. Would you be interested in helping? It's been in dev for about 2 months now. Several assets in production for it, including characters and the opening scene of the game. Me personally, I started the product and am going to help design and code the game. If you are interested pls reply here or contact me at antonyrobwells@gmail.com We're also working on our own 3d engine/ide similar to unity3d, that our second game will probably use.
  6. Vivid3DDev

    Need a team for a game project

    Hi, We are 8 people working on a project called Destiny of a starlit empire. We need a animator for our characters and other cut-scenes/gameplay. We have our website with private forums, and the project has been in dev for about 2 months now. We are working on the opening scene.The game will be episodic, about 2-3 hours per episode. If you're interested feel free to mail me @ antonyrobwells@gmail.com
  7. Hi, I am working with six other people(Several artists, 1 writer, 1 music guy) - and I am the coder myself. We are using Unity3D. The game is going to be an adventure/rpg type of game. it's called "Destiny Of A Starlit Empire" - we have our own domain/site and private forums/files sections. Would you be interested in helping with world/level modelling? It's been in production for about a month, and we're working on the first scene atm. If you interested pls mail me @ antonyrobwells@gamil.com - Thanks.
  8. Found an old project of mine(2006) for the original psp. It's a full 3D engine, and while I cannot remember all features, it can do quite a bit. It's a single source file, but a full engine. it includes some demo code. It obviously requires a modded psp, but uses the open source pspdev toolchain. feel free to use anyway you wish. (Sorry if this isn't appropriate for this forum, feel free to delete if so.) https://t.co/crRGkZJB35
  9. Vivid3DDev

    Artist looking for team/partner!

    Hi, We are seven developers making an adventure/rpg game. It's only been in dev for a few weeks but we are making progress. We have our own domain/website with private files/forums sections.And we're looking for more members. So i'd like to see your work if you are interested. You can mail me at antonyrobwells@gmail.com if you are interested. Thanks. (We're using unity3d btw)
  10. Hi, If you see above, that's the sort of style we're going for. There is a design doc on google-drive i can link you to. It describes the opening scene and will be furthered. We don't have our own concept artist yet. The team is atm, 1. Me 2.Noah - Artist 3. Noah - Music|(Different guy, than our aritst, just same name) 4.Another 3D artist doing characters. 5.Callum - Creative writer And a couple of other guys i'm talking to, now including you. Scene 1, the opening area, is being handled by noah. But you could work on the second area? We do have a 2D artist, but he's working on logos etc. If you yourself know a concept artist, pls feel free to introduce him to us. So yeah if you're interested, pls contact me @ antonyrobwells@gmail.com - cheers.
  11. Hi, More serious in tone. It will have comedic moments, but mostly a adventure/sci-fi story.
  12. Not been coding it lately, but I will post an update once it's working or at least working better.
  13. Imagine beneath a steel sky, but on modern hardware. It will be fully 3D, but may be still set cameras and point and click interface. - We have 1 artist and 1 music guy atm. Here are a few example shots, that could set the tone for the game. not ours, just off the web.
  14. Hey, great music - I am a exp coder/designer, and here is a link to my new product, if you have any interest helping.
  15. I am looking to develop a 3D Graphic Adventure - Inspired by classic games like Beneath A Steel Sky and Monkey island; in style. The game will not be 2D, it will use a custom 3D engine/ide that has been in dev since 2017, called VectorEngine. The game focuses on a galactic war between two space-faring races in a galaxy far away, as it goes. The main story will resolve around Vince and his companion, Opia. It will have puzzles, story, cinematics, mini-games and some combat sections. So, we are looking for - 3D artists(Environment/Character/Props) and 2D Artists(UI/Menus/Textures) - Also we are looking for one or two creative writers. Finally, a C# coder with experience with 3D engines, and OpenGL(Via OpenTK) would be helpful. This is a product intended to be sold on online stores etc, so there will be royalties and future reward, but no immediate pay. Although the engine/ide are quite far along, the game is a new product intended to be made with it, so no screenshots yet. I am Antony Wells, and I am going to code and help design the game. All members who join can also help with design, whatever their main role. Reply here or email me at antonyrobwells@gmail.com
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!