Jump to content
  • Advertisement

Search the Community

Showing results for tags 'Visual Studio'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Categories

  • Audio
    • Music and Sound FX
  • Business
    • Business and Law
    • Career Development
    • Production and Management
  • Game Design
    • Game Design and Theory
    • Writing for Games
    • UX for Games
  • Industry
    • Interviews
    • Event Coverage
  • Programming
    • Artificial Intelligence
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Engines and Middleware
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
  • Archive

Categories

  • Audio
  • Visual Arts
  • Programming
  • Writing

Categories

  • Game Dev Loadout
  • Game Dev Unchained

Categories

  • Game Developers Conference
    • GDC 2017
    • GDC 2018
  • Power-Up Digital Games Conference
    • PDGC I: Words of Wisdom
    • PDGC II: The Devs Strike Back
    • PDGC III: Syntax Error

Forums

  • Audio
    • Music and Sound FX
  • Business
    • Games Career Development
    • Production and Management
    • Games Business and Law
  • Game Design
    • Game Design and Theory
    • Writing for Games
  • Programming
    • Artificial Intelligence
    • Engines and Middleware
    • General and Gameplay Programming
    • Graphics and GPU Programming
    • Math and Physics
    • Networking and Multiplayer
  • Visual Arts
    • 2D and 3D Art
    • Critique and Feedback
  • Community
    • GameDev Challenges
    • GDNet+ Member Forum
    • GDNet Lounge
    • GDNet Comments, Suggestions, and Ideas
    • Coding Horrors
    • Your Announcements
    • Hobby Project Classifieds
    • Indie Showcase
    • Article Writing
  • Affiliates
    • NeHe Productions
    • AngelCode
  • Topical
    • Virtual and Augmented Reality
    • News
  • Workshops
    • C# Workshop
    • CPP Workshop
    • Freehand Drawing Workshop
    • Hands-On Interactive Game Development
    • SICP Workshop
    • XNA 4.0 Workshop
  • Archive
    • Topical
    • Affiliates
    • Contests
    • Technical
  • GameDev Challenges's Topics
  • For Beginners's Forum

Calendars

  • Community Calendar
  • Games Industry Events
  • Game Jams
  • GameDev Challenges's Schedule

Blogs

There are no results to display.

There are no results to display.

Product Groups

  • Advertisements
  • GameDev Gear

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Website


Role


Twitter


Github


Twitch


Steam

Found 70 results

  1. Well, since adopting the KV database into my server architecture I've begun to rethink many of my earlier assumptions, one of them being that I would continue developing my servers on Windows until I was past alpha stage... Since I've already brought a Linux solution into the core of the architecture, now is the best time to rewrite the servers to meet their life-long hosts. Not only that, it's a good opportunity to rethink and retouch some bits and bytes. So, using the same CentOS7 VM I'm running redis on, I'll begin the process using what appears to be a fairly polished version of Visual Studio for Linux (Visual Studio Code) https://code.visualstudio.com/ But first, because I installed from the minimal distribution.. Gonna need a Gui. yum groupinstall "GNOME Desktop" Gotta get all Microsofty with it next.. Here's the Microsoft repos to install the dotnet sdk: https://docs.microsoft.com/en-us/windows-server/administration/linux-package-repository-for-microsoft-software Got those installed and then: yum install dotnet-sdk-x.x.x To get the sdk commands to work I did have to manually install 'libunwind-devel' as the ONLY missed prerequisite in this whole process. If you know anything about installing non-standard packages on linux, that's fairly impressive. I installed VSC from Microsoft's downloadable .rpm file. It actually had a reasonable number of STANDARD package dependencies, and didn't miss any... I'm still in shock. All in all, so far, I have to say I'm quite impressed with the progress that Microsoft's cross platform tools have made in the last few years... I haven't tried to do anything like this (.net on linux) in probably 4 or 5 years, but it was fairly crap back then... That's probably another reason I was initially putting off the rewrite for Linux. Now, well, you know where I'll be.
  2. Hey all! I thought I would lay my post out a little different just so you can skip to the main parts that you wish to see. I Am: CheekyTrooper / Jason (JSON) Who Am I: I am 25 years old, software developer working on websites currently (C#, T-SQL, HTML5, CSS3, Sass, Angular, IIS) from England (for timezone purposes). What am I looking for: I am seeking a individual / team to join so that I can expand my game programming skills further and make some cool stuff . I don't really want a MMORPG to start working on, a small game would be better for myself. Motivators and encourages so we can push each other forwards. Previous Experience: I have created a zombie survival game in Game Maker, I have created a non-engine nodeJS html5 multiplayer chat node application (Little circles floating around with ability to chat). Engines I Know: I have previously used Unity, Game Maker, GoDot, and played around with code not in an engine. Languages I Know: C#, HTML5, CSS3, Sass, GML(Game Maker Language), T-SQL, Javascript. How long can I dedicate to the project: I work from 6am - 4pm, Monday - Friday. Saturday morning I take my daughter to gymnastics. Other than this i am pretty dedicated and determined to create something great!. How to contact: Please PM myself, or view my profile to see my Twitter or website to get hold of myself. I look forward to hearing from you! Take Care.
  3. Brizzler

    UWP Indie Game Review

    Hey Everyone, I'd like to review some of your indies games! I'm interested in games made for the Universal Windows Platform (UWP). Reply to this post if your interested in having your games reviewed and youtubed on my channel: UWPdeveloper Cheers, B
  4. Hello! I'm trying to understand how to load models with Assimp. Well learning how to use this library isn't that hard, the thing is how to use the data. From what I understand so far, each model consists of several meshes which you can render individually in order to get the final result (the model). Also from what assimp says: One mesh uses only a single material everywhere - if parts of the model use a different material, this part is moved to a separate mesh at the same node The only thing that confuses me is how to create the shader that will use these data to draw a mesh. Lets say I have all the information about a mesh like this: class Meshe { std::vector<Texture> diffuse_textures; std::vector<Texture> specular_textures; std::vector<Vertex> vertices; std::vector<unsigned int> indices; } And lets make the simplest shaders: Vertex Shader: #version 330 core layout(location = 0) in vec3 aPos; layout(location = 1) in vec3 aNormal; layout(location = 2) in vec2 aTexCoord; uniform vec3 model; uniform vec3 view; uniform vec3 projection; out vec2 TextureCoordinate; out vec3 Normals; void main() { gl_Position = projection * view * model * vec4(aPos, 1.0f); TextureCoordinate = aTexCoord Normals = normalize(mat3(transpose(inverse(model))) * aNormal); } Fragment Shader: #version 330 core out vec4 Output; in vec2 TextureCoordinate; in vec3 Normals; uniform sampler2D diffuse; uniform sampler2D specular; void main() { Output = texture(diffuse, TextureCoordinate); } Will this work? I mean, assimp says that each mesh has only one material that covers it, but that material how many diffuse and specular textures can it have? Does it makes sense for a material to have more than one diffuse or more that one specular textures? If each material has only two textures, one for the diffuse and one for the specular then its easy, i'm using the specular texture on the lighting calculations and the diffuse on the actual output. But what happens if the textures are more? How am i defining them on the fragment shader without knowing the actual number? Also how do i use them?
  5. As the title says, I'm a bit stumped on this. I'm not sure what to do for the write_callback of libFLAC++. I have implemented the rest of the callbacks correctly (I think). So that way, libFLAC can decode using an ifstream rather than a C-style FILE*. Below is my implementation of the decoder and its callbacks. #include <FLAC++/decoder.h> #include <fstream> #include <iostream> class FLACStreamDecoder : public FLAC::Decoder::Stream { private: std::ifstream& input; uint32_t sample_rate; uint32_t channels; uint32_t bits_per_sample; public: ~FLACStreamDecoder(); // The FLAC decoder will take ownership of the ifstream. FLACStreamDecoder(std::ifstream& arg) : FLAC::Decoder::Stream(), input(arg) {} uint32_t getSampleRate() { return sample_rate; } uint32_t getChannels() { return channels; } uint32_t getBitsPerSample() { return bits_per_sample; } virtual void metadata_callback(const FLAC__StreamMetadata *); virtual ::FLAC__StreamDecoderReadStatus read_callback(FLAC__byte *, size_t *); virtual ::FLAC__StreamDecoderWriteStatus write_callback(const FLAC__Frame *, const FLAC__int32 * const *); virtual void error_callback(FLAC__StreamDecoderErrorStatus); virtual ::FLAC__StreamDecoderSeekStatus seek_callback(FLAC__uint64 absolute_byte_offset); virtual ::FLAC__StreamDecoderTellStatus tell_callback(FLAC__uint64 *absolute_byte_offset); virtual ::FLAC__StreamDecoderLengthStatus length_callback(FLAC__uint64 *stream_length); virtual bool eof_callback(); }; FLACStreamDecoder::~FLACStreamDecoder() { input.close(); } void FLACStreamDecoder::metadata_callback(const FLAC__StreamMetadata * metadata) { std::cerr << "metadata callback called!" << std::endl; if (FLAC__METADATA_TYPE_STREAMINFO == metadata->type) { std::cerr << "streaminfo found!" << std::endl; sample_rate = metadata->data.stream_info.sample_rate; channels = metadata->data.stream_info.channels; bits_per_sample = metadata->data.stream_info.bits_per_sample; } } static_assert(sizeof(char) == sizeof(FLAC__byte), "invalid char size"); FLAC__StreamDecoderReadStatus FLACStreamDecoder::read_callback(FLAC__byte * buffer, size_t * nbytes) { if (nbytes && *nbytes > 0) { input.read(reinterpret_cast<char *>(buffer), *nbytes); *nbytes = input.gcount(); if (input.fail()) { return FLAC__STREAM_DECODER_READ_STATUS_ABORT; } else if (input.eof()) { return FLAC__STREAM_DECODER_READ_STATUS_END_OF_STREAM; } else { return FLAC__STREAM_DECODER_READ_STATUS_CONTINUE; } } else { return FLAC__STREAM_DECODER_READ_STATUS_ABORT; } } ::FLAC__StreamDecoderSeekStatus FLACStreamDecoder::seek_callback(FLAC__uint64 absolute_byte_offset) { if (input.is_open()) { input.seekg(absolute_byte_offset); return FLAC__StreamDecoderSeekStatus::FLAC__STREAM_DECODER_SEEK_STATUS_OK; } return FLAC__StreamDecoderSeekStatus::FLAC__STREAM_DECODER_SEEK_STATUS_ERROR; } ::FLAC__StreamDecoderTellStatus FLACStreamDecoder::tell_callback(FLAC__uint64 *absolute_byte_offset) { if (input.is_open()) { *absolute_byte_offset = input.tellg(); return FLAC__StreamDecoderTellStatus::FLAC__STREAM_DECODER_TELL_STATUS_OK; } return FLAC__StreamDecoderTellStatus::FLAC__STREAM_DECODER_TELL_STATUS_ERROR; } ::FLAC__StreamDecoderLengthStatus FLACStreamDecoder::length_callback(FLAC__uint64 *stream_length) { if (input.is_open()) { std::streampos currentPos = input.tellg(); input.seekg(std::ios::end); *stream_length = input.tellg(); input.seekg(currentPos); return FLAC__StreamDecoderLengthStatus::FLAC__STREAM_DECODER_LENGTH_STATUS_OK; } return FLAC__StreamDecoderLengthStatus::FLAC__STREAM_DECODER_LENGTH_STATUS_ERROR; } bool FLACStreamDecoder::eof_callback() { return input.eof(); } // This is called for every audio frame. FLAC__StreamDecoderWriteStatus FLACStreamDecoder::write_callback(const FLAC__Frame * frame, const FLAC__int32 * const * buffer) { // A the size of a FLAC Frame is frame->header.channels * frame->header.blocksize. That is, the size of the buffer array is the number of channels in the current frame, times the number of samples per channel (blocksize). return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } void FLACStreamDecoder::error_callback(FLAC__StreamDecoderErrorStatus status) { std::string msg; switch (status) { case FLAC__STREAM_DECODER_ERROR_STATUS_BAD_HEADER: msg = "BAD HEADER"; break; case FLAC__STREAM_DECODER_ERROR_STATUS_LOST_SYNC: msg = "LOST SYNC"; break; case FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH: msg = "FRAME CRC MISMATCH"; break; case FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM: msg = "UNPARSEABLE STREAM"; break; default: msg = "UNKNOWN ERROR"; break; } std::cerr << msg << std::endl; } As you see, I have no idea what to do for the write_callback. Any help with regards to that would be appreciated. To be a bit more clear, the problem is that WASAPI has a frame size of numChannels * bitsPerSample bits, or numChannels * bitsPerSample / 8 bytes. I can't seem to figure out how to go from a FLAC frame to a WASAPI frame. I'll also paste my WASAPI playback code below: #pragma once #include <iostream> #define NOMINMAX #include <Mmdeviceapi.h> #include <Audioclient.h> #include <fstream> #include <algorithm> class WASAPIBackend { public: WASAPIBackend(); ~WASAPIBackend(); private: HRESULT hr; IMMDeviceEnumerator* pDeviceEnumerator; IMMDevice* pDevice; IAudioClient3* pAudioClient; IAudioRenderClient* pAudioRenderClient; //WAVEFORMATEX* pMixFormat; WAVEFORMATEX mixFormat; uint32_t defaultPeriodInFrames, fundamentalPeriodInFrames, minPeriodInFrames, maxPeriodInFrames; HANDLE audioSamplesReadyEvent; }; #include "WASAPIBackend.h" constexpr void SafeRelease(IUnknown** p) { if (p) { (*p)->Release(); } } WASAPIBackend::WASAPIBackend() : hr(0), pDeviceEnumerator(nullptr), pDevice(nullptr), pAudioClient(nullptr), pAudioRenderClient(nullptr)/*, pMixFormat(nullptr)*/ { try { // COM result hr = S_OK; hr = CoInitializeEx(nullptr, COINIT_MULTITHREADED); if (FAILED(hr)) throw std::runtime_error("CoInitialize error"); hr = CoCreateInstance( __uuidof(MMDeviceEnumerator), nullptr, CLSCTX_ALL, __uuidof(IMMDeviceEnumerator), reinterpret_cast<void**>(&pDeviceEnumerator)); if (FAILED(hr)) throw std::runtime_error("CoCreateInstance error"); hr = pDeviceEnumerator->GetDefaultAudioEndpoint(EDataFlow::eRender, ERole::eConsole, &pDevice); if (FAILED(hr)) throw std::runtime_error("IMMDeviceEnumerator.GetDefaultAudioEndpoint error"); std::cout << "IMMDeviceEnumerator.GetDefaultAudioEndpoint()->OK" << std::endl; hr = pDevice->Activate(__uuidof(IAudioClient3), CLSCTX_ALL, nullptr, reinterpret_cast<void**>(&pAudioClient)); if (FAILED(hr)) throw std::runtime_error("IMMDevice.Activate error"); std::cout << "IMMDevice.Activate()->OK" << std::endl; WAVEFORMATEX wave_format = {}; wave_format.wFormatTag = WAVE_FORMAT_PCM; wave_format.nChannels = 2; wave_format.nSamplesPerSec = 44100; //nSamplesPerSec * nBlockAlign wave_format.nAvgBytesPerSec = 44100 * 2 * 16 / 8; wave_format.nBlockAlign = 2 * 16 / 8; wave_format.wBitsPerSample = 16; //pAudioClient->GetMixFormat(reinterpret_cast<WAVEFORMATEX**>(&wave_format)); hr = pAudioClient->GetSharedModeEnginePeriod(&wave_format, &defaultPeriodInFrames, &fundamentalPeriodInFrames, &minPeriodInFrames, &maxPeriodInFrames); hr = pAudioClient->GetSharedModeEnginePeriod(&wave_format, &defaultPeriodInFrames, &fundamentalPeriodInFrames, &minPeriodInFrames, &maxPeriodInFrames); if (FAILED(hr)) throw std::runtime_error("IAudioClient.GetDevicePeriod error"); std::cout << "default device period=" << defaultPeriodInFrames << "[nano seconds]" << std::endl; std::cout << "minimum device period=" << minPeriodInFrames << "[nano seconds]" << std::endl; hr = pAudioClient->InitializeSharedAudioStream(AUDCLNT_STREAMFLAGS_EVENTCALLBACK, minPeriodInFrames, &wave_format, nullptr); if (FAILED(hr)) throw std::runtime_error("IAudioClient.Initialize error"); std::cout << "IAudioClient.Initialize()->OK" << std::endl; // event audioSamplesReadyEvent = CreateEvent(nullptr, false, false, nullptr); if (FAILED(hr)) throw std::runtime_error("CreateEvent error"); hr = pAudioClient->SetEventHandle(audioSamplesReadyEvent); if (FAILED(hr)) throw std::runtime_error("IAudioClient.SetEventHandle error"); UINT32 numBufferFrames = 0; hr = pAudioClient->GetBufferSize(&numBufferFrames); if (FAILED(hr)) throw std::runtime_error("IAudioClient.GetBufferSize error"); std::cout << "buffer frame size=" << numBufferFrames << "[frames]" << std::endl; hr = pAudioClient->GetService(__uuidof(IAudioRenderClient), reinterpret_cast<void**>(&pAudioRenderClient)); std::cout << std::hex << hr << std::endl; if (FAILED(hr)) throw std::runtime_error("IAudioClient.GetService error"); BYTE *pData = nullptr; hr = pAudioRenderClient->GetBuffer(numBufferFrames, &pData); if (FAILED(hr)) throw std::runtime_error("IAudioRenderClient.GetBuffer error"); const char* flac_filename = "audio/07 DaMonz - Choose Your Destiny (Super Smash Bros. Melee).flac"; std::ifstream stream(flac_filename, std::ifstream::binary); FLACStreamDecoder streamer(stream); auto initStatus = streamer.init(); if (FLAC__STREAM_DECODER_INIT_STATUS_OK != initStatus) { std::cerr << "ERROR INITIALIZING" << std::endl; } else { streamer.process_until_end_of_metadata(); if (!streamer.process_single()) { std::cerr << "FAILED PROCESSING" << std::endl; } else { std::cerr << "SUCCEEDED PROCESSING" << std::endl; } } hr = pAudioRenderClient->ReleaseBuffer(numBufferFrames, 0); if (FAILED(hr)) throw std::runtime_error("IAudioRenderClient.ReleaseBuffer error"); AudioClientProperties audioClientProp = {}; audioClientProp.cbSize = sizeof(AudioClientProperties); audioClientProp.bIsOffload = true; audioClientProp.eCategory = AUDIO_STREAM_CATEGORY::AudioCategory_GameMedia; audioClientProp.Options = AUDCLNT_STREAMOPTIONS::AUDCLNT_STREAMOPTIONS_MATCH_FORMAT; pAudioClient->SetClientProperties(&audioClientProp); hr = pAudioClient->Start(); if (FAILED(hr)) throw std::runtime_error("IAudioClient.Start error"); std::cout << "IAudioClient.Start()->OK" << std::endl; //bool playing = (streamer.get_total_samples() > numBufferFrames); while (/*playing*/ true) { WaitForSingleObject(audioSamplesReadyEvent, INFINITE); uint32_t numPaddingFrames = 0; hr = pAudioClient->GetCurrentPadding(&numPaddingFrames); if (FAILED(hr)) throw std::runtime_error("IAudioClient.GetCurrentPadding error"); uint32_t numAvailableFrames = numBufferFrames - numPaddingFrames; if (numAvailableFrames == 0) continue; hr = pAudioRenderClient->GetBuffer(numAvailableFrames, &pData); if (FAILED(hr)) throw std::runtime_error("IAudioRenderClient.GetBuffer error"); for (size_t i = 0; i < numAvailableFrames; ++i) { streamer.process_single(); memcpy(&pData[i], &m_audioFrame, streamer.get_blocksize() * streamer.getChannels()); } hr = pAudioRenderClient->ReleaseBuffer((uint32_t)numAvailableFrames, 0); if (FAILED(hr)) throw std::runtime_error("IAudioRenderClient.ReleaseBuffer error"); //playing = (streamer.get_total_samples() < numAvailableFrames); } do { // wait for buffer to be empty WaitForSingleObject(audioSamplesReadyEvent, INFINITE); uint32_t numPaddingFrames = 0; hr = pAudioClient->GetCurrentPadding(&numPaddingFrames); if (FAILED(hr)) throw std::runtime_error("IAudioClient.GetCurrentPadding error"); if (numPaddingFrames == 0) { std::cout << "current buffer padding=0[frames]" << std::endl; break; } } while (true); hr = pAudioClient->Stop(); if (FAILED(hr)) throw std::runtime_error("IAudioClient.Stop error"); std::cout << "IAudioClient.Stop()->OK" << std::endl; } catch (std::exception& ex) { std::cout << "error:" << ex.what() << std::endl; } } WASAPIBackend::~WASAPIBackend() { //CoTaskMemFree(pMixFormat); if (audioSamplesReadyEvent) CloseHandle(audioSamplesReadyEvent); SafeRelease(reinterpret_cast<IUnknown**>(&pAudioRenderClient)); SafeRelease(reinterpret_cast<IUnknown**>(&pAudioClient)); SafeRelease(reinterpret_cast<IUnknown**>(&pDevice)); SafeRelease(reinterpret_cast<IUnknown**>(&pDeviceEnumerator)); CoUninitialize(); } The playback loop is most definitely broken, but I can't fix it if the decoder isn't working. Please note that I'm doing this for learning purposes, to get a better understanding of how libraries like SDL_Mixer and libsndfile work at a more fundamental level.
  6. Brizzler

    Boof Master Reviews

    Hey Everyone, I'm new here and I'm looking to get some feedback on my new game. It's kind of addictive, so I'm thinking about adding some network based features. If you're up for it, please let me know what you think Here is the link: Boof Master For UWP Here's a quick video:
  7. Hi everybody ! I have a problem with the VS Graphics Debugger and a D3D12 desktop application. When I create my depth stencil resource, I create two descriptor heaps, one with HEAP_TYPE_DSV, and one with HEAP_TYPE_CBV_SRV_UAV (to rebuild position from depth map), both calls to CreateDescriptorHeap succeed. Then I create a shader-resource view, and a depth-stencil view. Things go well with and without the debugger, but when I use the graphics debugger, the application crashes stating that the CPU descriptor handles does not refer to a location in a descriptor heap when I call either CreateDepthStencilView or CreateShaderResourceView. Here is my code : { D3D12_DESCRIPTOR_HEAP_DESC heap_desc = {}; heap_desc.NumDescriptors = 1; heap_desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV; heap_desc.Flags = D3D12_DESCRIPTOR_HEAP_FLAG_NONE; ThrowIfFailed(device->CreateDescriptorHeap(&heap_desc, IID_PPV_ARGS(&m_SRVDescriptorHeap))); heap_desc.Type = D3D12_DESCRIPTOR_HEAP_TYPE_DSV; ThrowIfFailed(device->CreateDescriptorHeap(&heap_desc, IID_PPV_ARGS(&m_DSVDescriptorHeap))); } DXGI_FORMAT depth_format = DXGI_FORMAT_D24_UNORM_S8_UINT; DXGI_FORMAT depth_format_SRV = DXGI_FORMAT_R24_UNORM_X8_TYPELESS; D3D12_CLEAR_VALUE depth_clear = {}; depth_clear.Format = depth_format; depth_clear.DepthStencil.Depth = 1.0f; depth_clear.DepthStencil.Stencil = 0; ThrowIfFailed(device->CreateCommittedResource( &CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_DEFAULT), D3D12_HEAP_FLAG_NONE, &CD3DX12_RESOURCE_DESC::Tex2D( depth_format, width, height, 1, 0, 1, 0, D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL), D3D12_RESOURCE_STATE_DEPTH_WRITE, &depth_clear, IID_PPV_ARGS(&m_Resource) )); { D3D12_DEPTH_STENCIL_VIEW_DESC dstencil_desc = {}; dstencil_desc.Format = depth_format; dstencil_desc.ViewDimension = D3D12_DSV_DIMENSION_TEXTURE2D; dstencil_desc.Flags = D3D12_DSV_FLAG_NONE; // this call causes a crash device->CreateDepthStencilView(m_Resource, &dstencil_desc, m_DSVDescriptorHeap->GetCPUDescriptorHandleForHeapStart()); } { D3D12_SHADER_RESOURCE_VIEW_DESC srv_desc = {}; srv_desc.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING; srv_desc.Format = depth_format_SRV; srv_desc.ViewDimension = D3D12_SRV_DIMENSION_TEXTURE2D; srv_desc.Texture2D.MipLevels = 1; // this call causes a crash device->CreateShaderResourceView(m_Resource, &srv_desc, m_SRVDescriptorHeap->GetCPUDescriptorHandleForHeapStart()); } This is the message I get from the DebugLayer : D3D12 ERROR: ID3D12Device::CreateShaderResourceView: Specified CPU descriptor handle ptr=0x0000000000008781 does not refer to a location in a descriptor heap. [ EXECUTION ERROR #646: INVALID_DESCRIPTOR_HANDLE] I have no more information with the GPUBasedValidation. The only thing different I noticed with the graphics debugger is that the handle has a much smaller ptr (and always the same) than without it, but I suppose it's only due to the fact that the application is run in some kind of environment with the graphics debugger, right ? PIX gives me the same error (E_PIX_INVALID_DESCRIPTOR_HANDLE). Can anyone help me understand or give me a clue why I have this problem, please :| ? Many Thanks
  8. How can I change the skeletal mesh position in a c++ class? because I got this. I´m working in UE4 -> 4.20 I know that the pivot of the mesh is on the bottom, but there must be a way to change the position by code. By the way, my object is a character's derived class.
  9. I have made a simple 2D game supposed to run on Windows only using SFML. The executable is built using Visual Studio 2017. I would like to make sure that it can run on as many Windows machines as possible (even on Windows 7/8 if possible). What steps can I take to ensure that? I have done the following: Build for Win32 (x86) not x64 platform In Project Properties->C/C++->Code Generation, I set Runtime Library to Multi-threaded (runtime library should thus be statically packed with the exe) not Multi-Threaded DLL Would the following help with compatibility (and not cause problems with forward compatibility)? Using Windows SDK version 8.1? Use older platform toolset (not Visual Studio 2017 v141 but perhaps VS 2015 v140 or even VS 2015 Windows XP) What else can I do, and what should I be aware of? Thanks.
  10. Hello I'm a beginner in game programming and I'm programming in visual studio 2017 with OpenGL and SDL2 libraries Every time I try to build my project i have this problem and i don't what is the problem: 1>------ Build started: Project: TheGame, Configuration: Debug Win32 ------ 1>Cube.cpp 1>c:\users\king0k13\documents\games\thegame\thegame\game.h(18): error C2143: syntax error: missing ';' before '*' 1>c:\users\king0k13\documents\games\thegame\thegame\game.h(18): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>Main.cpp 1>Generating Code... 1>Done building project "TheGame.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== These are my Project files: - Game.h #pragma once #ifndef _GAME_H_ #define _GAME_H_ #include <iostream> #include <SDL.h> #include <SDL_opengl.h> #include <SOIL.h> #include <gl/gl.h> #include <string> #include "Cube.h" #define ScreenWidth 600 #define ScreenHeight 600 Cube* cube1; class Game { public: // Constructors Game(); ~Game(); // Functions void Initialize(); void SetOpenGLAttributes(); void InputHandler(); void Update(); void Render(); void Clean(); // Globals bool RunningStatus; private: SDL_Window* GameScreen; SDL_GLContext GameContext; SDL_Event GameEvents; }; #endif Error Line is: Cube* cube1; --------------------------------------------------------------------------------------------------------------- - Game.cpp #include "Game.h" Game::Game() { } Game::~Game() { } /****************************************************************************/ void Game::Initialize() { // Initilizng SDL if (SDL_Init(SDL_INIT_VIDEO) == 0) { std::cout << "SDL Initialized succesfully!" << std::endl; } else { std::cout << "Failed Initializing SDL : " << SDL_GetError() << std::endl; RunningStatus = false; } // Setting-Up The Game Screen GameScreen = SDL_CreateWindow("The Game", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, ScreenWidth, ScreenHeight, SDL_WINDOW_OPENGL | SDL_WINDOW_SHOWN); if (GameScreen == NULL) // Handling Errors { std::cout << "SDL Failed Creating Window : " << SDL_GetError() << std::endl; RunningStatus = false; } else { std::cout << "Creating Window Succesful!" << std::endl; std::cout << "Window Data : \n" << "\tTitle : The Game\n\tX , Y Position : (CENTERED , CENTERED)\n\tWidth and Height : (" << ScreenWidth << " , " << ScreenHeight << ")\n\tFlags : OpenGL | Shown\n" << std::endl; } // Creating Game Context for OpenGL use GameContext = SDL_GL_CreateContext(GameScreen); SetOpenGLAttributes(); // Setting OpenGLAttributes SDL_GL_SetSwapInterval(1); RunningStatus = true; // Turning on The Game Loop cube1->LoadTexture(); cube1->ActiveTexture(); } /****************************************************************************/ void Game::SetOpenGLAttributes() { SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); } /****************************************************************************/ void Game::InputHandler() { while (SDL_PollEvent(&GameEvents)) { switch (GameEvents.type) { case SDL_QUIT: RunningStatus = false; break; case SDL_KEYDOWN: switch (GameEvents.key.keysym.sym) { case SDLK_w: break; case SDLK_a: break; case SDLK_s: break; case SDLK_d: break; default: break; } break; default: break; } } } /****************************************************************************/ void Game::Update() { cube1->SetPosition(0, 0); } /****************************************************************************/ void Game::Render() { SDL_GL_SwapWindow(GameScreen); } /****************************************************************************/ void Game::Clean() { cube1->UnloadTexture(); SDL_GL_DeleteContext(GameContext); SDL_DestroyWindow(GameScreen); SDL_Quit(); } ----------------------------------------------------------------------------------------------------------------- - Cube.h #pragma once #ifndef _CUBE_H_ #define _CUBE_H_ #include "Game.h" class Cube { public: // Constractors Cube(); ~Cube(); // Functions void SetPosition(int x, int y); int GetPosition(); void LoadTexture(); void ActiveTexture(); void UnloadTexture(); // Globals //bool Hide; private: // Cube Position int X_pos; int Y_pos; //int Z_pos; // Cube Graphic unsigned char* CubeTexture; GLuint TextureID; int Channels; int Format; int T_Width; int T_Height; }; #endif ----------------------------------------------------------------------------------------------------------------- Cube.cpp #include "Cube.h" Cube::Cube() { } Cube::~Cube() { } /****************************************************************************/ void Cube::SetPosition(int x, int y) { X_pos = x; Y_pos = y; } /****************************************************************************/ int Cube::GetPosition() { return X_pos, Y_pos; } /****************************************************************************/ void Cube::LoadTexture() { Channels = 0; CubeTexture = SOIL_load_image("assets/Block.png", &T_Width, &T_Height, &Channels, SOIL_LOAD_AUTO); if (CubeTexture == NULL) { std::cout << "SOIL Failed to Load Texture" << std::endl; } Format = GL_RGB; if (Channels == 4) { Format = GL_RGBA; } glGenTextures(1, &TextureID); glBindTexture(GL_TEXTURE_2D, TextureID); glTexImage2D(GL_TEXTURE_2D, 0, Format, T_Width, T_Height, 0, Format, GL_UNSIGNED_BYTE, CubeTexture); SOIL_free_image_data(CubeTexture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); } void Cube::ActiveTexture() { glBindTexture(GL_TEXTURE_2D, TextureID); } void Cube::UnloadTexture() { glDeleteTextures(1, &TextureID); } ------------------------------------------------------------------------------------------------------------------- - Main.cpp #include "Game.h" int main(int argc, char* argv[]) { Game TheGame; TheGame.Initialize(); while (TheGame.RunningStatus) { TheGame.InputHandler(); TheGame.Update(); TheGame.Render(); } TheGame.Clean(); return 0; } I would be really happy if someone helps me to fix the error. P.S. : If someone have any good advice to help me coding my project better please tell me!
  11. I have some tutorials for OpenGL and after fixing the direction of the slashes the libs still do not resolve. So, I made a different link to a library in my own directory and everything works fine. The include directories are the same way, when I put in my own directories the project works otherwise it doesn't (errors.) There are files in the particular folders. Although I have found a workaround, I can't help but wonder how this problem could be officially fixed. Does anyone know this one? Oh, by the way, I'm using Visual Studio 2017. Thank You, Josheir
  12. I have been coding since the 90's, and have released a few minor succesfully 3D engines over the years, Vivid3D/Trinity3D/Aurora - Probably not heard of them, but I am quite skilled in the concept. So upon the announcement of RTX cards and their features, I was highly motivated to create a modern 3D engine, in C++(Visual studio 2017) using Vulkan. Atm I have a GTX 1060 - which is v.fast and is more than enough to build the base engine. In a few months I'll be getting a RTX 2070 to implement raytracing into the engine etc. The engine has only been in dev for a week or so, but it already has a basic structure, using classes. It will be a easy to use 3D engine, with support for model imports using AssImp. So my point is, I am looking for any other Vulkan coders, who might be interested in helping develop the engine? The code is on GitHub - open but I can make it private if we decide to commercialize the engine to make money/support futher development. I want to make a Deus Ex like mini-game to test and promote the engine, so you can help with that too, even if you are a 3D artist and interested, because I am just a coder atm. So yeah, if anyone is interested pls drop me a email or reply here, and I'll add you to the gitHub project(I'll need your github username) Note - a C# wrapper is planned also, if you are a c# coder and would like to help with that, demos/wrapper etc, that would be very cool. My email is antonyrwells@outlook.com Thank you.
  13. Hello! I need some advice on my new library, I'm not really confident about it... First a little of introduction: One of my biggest problems when creating a game or a game engine was how to perform the resource management (loading files, editing them, etc). I could just use a default "Data" folder, put all my files here and load them using the standard ways but we know that this is something problematic when the project starts to grow. I also don't think (or at least I don't know) there is a good library that could help with this task. Yeah I could use zlib or something like that but I decided to create my own, I did some improvements here and there, created a decent (at least I think) introduction/tutorial on its git page but I really don't know if any developer would use it on its currently state. Here is the link https://github.com/RodrigoHolztrattner/Packet (written in c++). It uses hashed paths to perform fast-mapping searches, it has 2 operation modes (one that allows editing and the other that is focused on performance), all resources uses reference counting and it has some other things that are listed on its github page (like the hot-reload capability for example). Unfortunatelly there are no working examples for now but I plan to add them in the future. Now I ask you, what do you think about using a library like this? Is it something that you would use for your game? Have I done some kind of overthinking when building it? Like I said I'm not really confident about it (although I'm using it on my projects and I feel it suit them really nice). Thank you for your time!
  14. I have some pre-compiled shaders in header files stored in arrays and sometimes, the cursor will hover over these arrays which means now Visual Studio has to preview the entire array. This causes the whole application to freeze. Is there a way to stop this from happening? const BYTE d3d_byte_code[] = {........... Very large array }; When the cursor hovers over d3d_byte_code, Visual studio will freeze trying to preview the contents of the array
  15. I am trying to communicate between 2 scripts that are in 2 different scenes. I start of in the home scene and than press a button that takes me into the main scene. When I go into the main scene I want a list of GameObjects to be disabled and another set of GameObjects to be enabled. - start off in the home scene- press a button that takes me to another scene (I can do this) - When I press button in home scene and enter main scene a list of gameobjects are disabled and another are enabled (struggling with this).
  16. Hello everyone, After a few years of break from coding and my planet render game I'm giving it a go again from a different angle. What I'm struggling with now is that I have created a Frustum that works fine for now atleast, it does what it's supose to do alltho not perfect. But with the frustum came very low FPS, since what I'm doing right now just to see if the Frustum worked is to recreate the vertex buffer every frame that the camera detected movement. This is of course very costly and not the way to do it. Thats why I'm now trying to learn how to create a dynamic vertexbuffer instead and to map and unmap the vertexes, in the end my goal is to update only part of the vertexbuffer that is needed, but one step at a time ^^ So below is my code which I use to create the Dynamic buffer. The issue is that I want the size of the vertex buffer to be big enough to handle bigger vertex buffers then just mPlanetMesh.vertices.size() due to more vertices being added later when I start to do LOD and stuff, the first render isn't the biggest one I will need. vertexBufferDesc.Usage = D3D11_USAGE_DYNAMIC; vertexBufferDesc.ByteWidth = mPlanetMesh.vertices.size(); vertexBufferDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; vertexBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; vertexBufferDesc.MiscFlags = 0; vertexBufferDesc.StructureByteStride = 0; vertexData.pSysMem = &mPlanetMesh.vertices[0]; vertexData.SysMemPitch = 0; vertexData.SysMemSlicePitch = 0; result = device->CreateBuffer(&vertexBufferDesc, &vertexData, &mVertexBuffer); if (FAILED(result)) { return false; } What happens is that the result = device->CreateBuffer(&vertexBufferDesc, &vertexData, &mVertexBuffer); Makes it crash due to Access Violation. When I put the vertices.size() in it works without issues, but when I try to set it to like vertices.size() * 2 it crashes. I googled my eyes dry tonight but doesn't seem to find people with the same kind of issue, I've read that the vertex buffer can be bigger if needed. What I'm I doing wrong here? Best Regards and Thanks in advance Toastmastern
  17. I am rendering a large number of objects for a simulation. Each object has instance data and the size of the instance data * number of objects is greater than 4GB. CreateCommittedResource is giving me: E_OUTOFMEMORY Ran out of memory. My PC has 128GB (only 8% ish used prior to testing this), I am running the DirectX app as x64. <Creating a CPU sided resource so GPU ram doesn't matter here, but using Titan X cards if that's a question> Simplified code test that recreates the issue (inserted the code into Microsofts D3D12HelloWorld): unsigned long long int siz = pow(2, 32) + 1024; D3D12_FEATURE_DATA_D3D12_OPTIONS options; //MaxGPUVirtualAddressBitsPerResource = 40 m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &options, sizeof(options)); HRESULT oops = m_device->CreateCommittedResource( &CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_UPLOAD), D3D12_HEAP_FLAG_NONE, &CD3DX12_RESOURCE_DESC::Buffer(siz), D3D12_RESOURCE_STATE_GENERIC_READ, nullptr, IID_PPV_ARGS(&m_vertexBuffer)); if (oops != S_OK) { printf("Uh Oh"); } I tried enabling "above 4G" in the bios, which didn't do anything. I also tested using malloc to allocate a > 4G array, that worked in the app without issue. Are there more options or build setup that needs to be done? (Using Visual Studio 2015) *Other approaches to solving this are welcome too. I thought about splitting up the set of items to render into a couple of sets with a size < 4G each but would rather have one set of objects. Thank you.
  18. Hi, currently I'm helping my friend with his master thesis creating 3d airplane simulation, which he will use as presentation {just part of the whole}. I've got Boening 737-800 model, which is read from obj file format and directly rendered using my simulator program. The model has many of moving parts, they move independently basing on defined balls. Here's left wing from the top to depict one element and its move logic: Each moving object {here it is aleiron_left} has two balls: _left and _right which define the horizontal line to rotate around. I created movement and rotate logic by just using translatef and rotatef, each object is moved independently within its own push and pop matrixes. Once the project runs I'm able to move the aleiron based on parameter I store in some variable, and it moves alright: First one is before move, and the second one after move. I added balls for direct reference with 3ds max model. The balls are also moved using translatef and rotatef using the same move logic, so they are "glued" to their parent part. Problem is, I need to calculate their world coordinates after move, so in the next step out of the render method I need to obtain direct x,y,z coordinates without again using translatef and rotatef. I tried to multiply some matrixes and so on, but without result and currently I've got no idea how to do that.. Fragment of code looks like this: void DrawModel(Model.IModel model) { GL.glLoadIdentity(); GL.glPushMatrix(); this.SetSceneByCamera(); foreach (Model.IModelPart part in model.ModelParts) this.DrawPart(part); GL.glPopMatrix(); } void DrawPart(Model.IModelPart part) { bool draw = true; GL.glPushMatrix(); #region get part children Model.IModelPart child_top = part.GetChild("_top"); Model.IModelPart child_left = part.GetChild("_left"); Model.IModelPart child_right = part.GetChild("_right"); Model.IModelPart child_bottom = part.GetChild("_bottom"); #endregion get part children #region by part switch (part.PartTBase) { case Model.ModelPart.PartTypeBase.ALEIRON: { #region aleiron float moveBy = 0.0f; bool selected = false; switch (part.PartT) { case Model.ModelPart.PartType.ALEIRON_L: { selected = true; moveBy = this.GetFromValDic(part); moveBy *= -1; } break; } if (selected && child_left != null && child_right != null) { GL.glTranslatef(child_right.GetCentralPoint.X, child_right.GetCentralPoint.Y, child_right.GetCentralPoint.Z); GL.glRotatef(moveBy, child_left.GetCentralPoint.X - child_right.GetCentralPoint.X, child_left.GetCentralPoint.Y - child_right.GetCentralPoint.Y, child_left.GetCentralPoint.Z - child_right.GetCentralPoint.Z); GL.glTranslatef(-child_right.GetCentralPoint.X, -child_right.GetCentralPoint.Y, -child_right.GetCentralPoint.Z); } #endregion aleiron } break; } #endregion by part #region draw part if (!part.Visible) draw = false; if (draw) { GL.glBegin(GL.GL_TRIANGLES); for (int i = 0; i < part.ModelPoints.Count; i += 3) { if (part.ModelPoints[i].GetTexCoord != null) GL.glTexCoord3d((double)part.ModelPoints[i].GetTexCoord.X, (double)part.ModelPoints[i].GetTexCoord.Y, (double)part.ModelPoints[i].GetTexCoord.Z); GL.glVertex3f(part.ModelPoints[i].GetPoint.X, part.ModelPoints[i].GetPoint.Y, part.ModelPoints[i].GetPoint.Z); if (part.ModelPoints[i + 1].GetTexCoord != null) GL.glTexCoord3d((double)part.ModelPoints[i + 1].GetTexCoord.X, (double)part.ModelPoints[i + 1].GetTexCoord.Y, (double)part.ModelPoints[i + 1].GetTexCoord.Z); GL.glVertex3f(part.ModelPoints[i + 1].GetPoint.X, part.ModelPoints[i + 1].GetPoint.Y, part.ModelPoints[i + 1].GetPoint.Z); if (part.ModelPoints[i + 2].GetTexCoord != null) GL.glTexCoord3d((double)part.ModelPoints[i + 2].GetTexCoord.X, (double)part.ModelPoints[i + 2].GetTexCoord.Y, (double)part.ModelPoints[i + 2].GetTexCoord.Z); GL.glVertex3f(part.ModelPoints[i + 2].GetPoint.X, part.ModelPoints[i + 2].GetPoint.Y, part.ModelPoints[i + 2].GetPoint.Z); } GL.glEnd(); } #endregion draw part GL.glPopMatrix(); } What happens step by step: Prepare scene, set the model camera by current variables {user can move camera using keyboard and mouse in all directions}. Take model which contains all modelParts within and draw them one by one. Each part has its own type and subtype set by part name. Draw current part independently, get its child_left and child_right -> those are the balls by name. Get moveBy value which is angle. Every part has its own variable which is modified using keyboard like "press a, increase variable x for 5.0f", which in turn will rotate aleiron up by 5.0f. Move and rotate object by its children Draw part triangles {the part has its own list of triangles that are read from obj file} When I compute the blue ball that is glued to its parent, I do exactly the same so it moves with the same manner: case Model.ModelPart.PartTypeBase.FLOW: { float moveBy = 0.0f; Model.IModelPart parent = part.GetParent(); if (parent != null) { moveBy = this.GetFromValDic(parent); if (parent.Reverse) moveBy *= -1.0f; child_left = parent.GetChild("_left"); child_right = parent.GetChild("_right"); } if (child_left != null && child_right != null) { GL.glGetFloatv(GL.GL_MODELVIEW_MATRIX, part.BeforeMove); GL.glTranslatef(child_right.GetCentralPoint.X, child_right.GetCentralPoint.Y, child_right.GetCentralPoint.Z); GL.glRotatef(moveBy, child_left.GetCentralPoint.X - child_right.GetCentralPoint.X, child_left.GetCentralPoint.Y - child_right.GetCentralPoint.Y, child_left.GetCentralPoint.Z - child_right.GetCentralPoint.Z); GL.glTranslatef(-child_right.GetCentralPoint.X, -child_right.GetCentralPoint.Y, -child_right.GetCentralPoint.Z); } } break; Before move I read the model matrix using GL.glGetFloatv(GL.GL_MODEL_MATRIX, matrix), which gives me those values {red contains current model camera}: The blue ball has its own initial central point computed, and currently it is (x, y, z): 339.6048, 15.811758, -166.209473. As far as I'm concerned, the point world coordinates never change, only its matrix is moved and rotated around some point. So the final question is, how to calculate the same point world coordinates after the object is moved and rotated? PS: to visualize the problem, I've created new small box, which I placed on the center of the blue ball after it is moved upwards. The position of the box is written by eye - I just placed it couple of times and after x try, I managed to place it correctly using similar world coordinates: First one is from the left of the box, and the second one is from behind. The box world coordinates are (x, y, z): 340.745117f, 30.0f, -157.6322f, so according to original central point of blue ball it is a bit higher and closer to the center of the wing. Simply put, I need to: take original central point of blue ball: 339.6048, 15.811758, -166.209473 after the movement and rotation of the blue ball is finished, apply some algorithm {like take something from modelview_matrix, multiply by something other} finally, after the algorithm is complete, in result I get 340.745117f, 30.0f, -157.6322f point {but now computed}, which is the central point in world matrix after movement. PS2: Sorry for long post, I tried to exactly explain what I'm dealing with. Thank you in advance for your help.
  19. I want implement Particle system based on stream out structure to my bigger project. I saw few articles about that method and I build one particle. It works almost correctly but in geometry shader with stream out i cant get value of InitVel.z and age because it always is 0. If i change order of age(for example age is before Position) it works fine for age but 6th float of order is still 0. It looks like he push only 5 first positions. I had no idea what i do wrong because i try change almost all(create input layout for vertex, the same like entry SO Declaration, change number of strides for static 28, change it to 32 but in this case he draw chaotic so size of strides is probably good). I think it is problem with limits of NumEntry in declaration Entry but on site msdn i saw the limit for directx is D3D11_SO_STREAM_COUNT(4)*D3D11_SO_OUTPUT_COMPONENT_COUNT(128) not 5. Pls can you look in this code and give me the way or hope of implement it correctly?? Thanks a lot for help. Structure of particle struct Particle{ Particle() {} Particle(float x, float y, float z,float vx, float vy, float vz,float l /*UINT typ*/) :InitPos(x, y, z), InitVel(vx, vy, vz), Age(l) /*, Type(typ)*/{} XMFLOAT3 InitPos; XMFLOAT3 InitVel; float Age; //UINT Type; }; SO Entry D3D11_SO_DECLARATION_ENTRY PartlayoutSO[] = { { 0,"POSITION", 0, 0 , 3, 0 }, // output all components of position { 0,"VELOCITY", 0, 0, 3, 0 }, { 0,"AGE", 0, 0, 1, 0 } //{ 0,"TYPE", 0, 0, 1, 0 } }; Global Variables //streamout shaders ID3D11VertexShader* Part_VSSO; ID3D11GeometryShader* Part_GSSO; ID3DBlob *Part_GSSO_Buffer; ID3DBlob *Part_VSSO_Buffer; //normal shaders ID3D11VertexShader* Part_VS; ID3D11GeometryShader* Part_GS; ID3DBlob *Part_GS_Buffer; ID3D11PixelShader* Part_PS; ID3DBlob *Part_VS_Buffer; ID3DBlob *Part_PS_Buffer; ID3D11Buffer* PartVertBufferInit; //ID3D11Buffer* Popy; ID3D11Buffer* mDrawVB; ID3D11Buffer* mStreamOutVB; ID3D11InputLayout* PartVertLayout;// I try to set input layout too void ParticleSystem::InitParticles() { mFirstRun = true; srand(time(NULL)); hr = D3DCompileFromFile(L"ParticleVertexShaderSO4.hlsl", NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "vs_5_0", NULL, NULL, &Part_VSSO_Buffer, NULL); hr = D3DCompileFromFile(L"ParticleGeometryShaderSO4.hlsl", NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "gs_5_0", NULL, NULL, &Part_GSSO_Buffer, NULL); UINT StrideArray[1] = { sizeof(Particle) };//I try to set static 28 bits-7*4 per float hr = device->CreateVertexShader(Part_VSSO_Buffer->GetBufferPointer(), Part_VSSO_Buffer->GetBufferSize(), NULL, &Part_VSSO); hr = device->CreateGeometryShaderWithStreamOutput(Part_GSSO_Buffer- >GetBufferPointer(), Part_GSSO_Buffer->GetBufferSize(), PartlayoutSO ,3/* sizeof(PartlayoutSO)*/ , StrideArray, 1,D3D11_SO_NO_RASTERIZED_STREAM, NULL,&Part_GSSO); //Draw Shaders hr = D3DCompileFromFile(L"ParticleVertexShaderDRAW4.hlsl", NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "vs_5_0", NULL, NULL, &Part_VS_Buffer, NULL); hr = D3DCompileFromFile(L"ParticleGeometryShaderDRAW4.hlsl", NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "gs_5_0", NULL, NULL, &Part_GS_Buffer, NULL); hr = D3DCompileFromFile(L"ParticlePixelShaderDRAW4.hlsl", NULL, D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "ps_5_0", NULL, NULL, &Part_PS_Buffer, NULL); hr = device->CreateVertexShader(Part_VS_Buffer->GetBufferPointer(), Part_VS_Buffer->GetBufferSize(), NULL, &Part_VS); hr = device->CreateGeometryShader(Part_GS_Buffer->GetBufferPointer(), Part_GS_Buffer->GetBufferSize(), NULL, &Part_GS); hr = device->CreatePixelShader(Part_PS_Buffer->GetBufferPointer(), Part_PS_Buffer->GetBufferSize(), NULL, &Part_PS); BuildVertBuffer(); } void ParticleSystem::BuildVertBuffer() { D3D11_BUFFER_DESC vertexBufferDesc1; ZeroMemory(&vertexBufferDesc1, sizeof(vertexBufferDesc1)); vertexBufferDesc1.Usage = D3D11_USAGE_DEFAULT; vertexBufferDesc1.ByteWidth = sizeof(Particle)*1; //*numParticles; vertexBufferDesc1.BindFlags = D3D11_BIND_VERTEX_BUFFER;// | D3D11_BIND_STREAM_OUTPUT; vertexBufferDesc1.CPUAccessFlags = 0; vertexBufferDesc1.MiscFlags = 0; vertexBufferDesc1.StructureByteStride = 0;// I tried to comment this too Particle p; ZeroMemory(&p, sizeof(Particle)); p.InitPos = XMFLOAT3(0.0f, 0.0f, 0.0f); p.InitVel = XMFLOAT3(0.0f, 0.0f, 0.0f); p.Age = 0.0f; //p.Type = 100.0f; D3D11_SUBRESOURCE_DATA vertexBufferData1; ZeroMemory(&vertexBufferData1, sizeof(vertexBufferData1)); vertexBufferData1.pSysMem = &p;//było &p vertexBufferData1.SysMemPitch = 0; vertexBufferData1.SysMemSlicePitch = 0; hr = device->CreateBuffer(&vertexBufferDesc1, &vertexBufferData1, &PartVertBufferInit); ZeroMemory(&vertexBufferDesc1, sizeof(vertexBufferDesc1)); vertexBufferDesc1.ByteWidth = sizeof(Particle) * numParticles; vertexBufferDesc1.BindFlags = D3D11_BIND_VERTEX_BUFFER | D3D11_BIND_STREAM_OUTPUT; hr = device->CreateBuffer(&vertexBufferDesc1, 0, &mDrawVB); hr = device->CreateBuffer(&vertexBufferDesc1, 0, &mStreamOutVB); } void ParticleSystem::LoadDataParticles() { UINT stride = sizeof(Particle); UINT offset = 0; //Create the Input Layout //device->CreateInputLayout(Partlayout, numElementsPart, Part_VSSO_Buffer- //>GetBufferPointer(), // Part_VSSO_Buffer->GetBufferSize(), &PartVertLayout); //Set the Input Layout //context->IASetInputLayout(PartVertLayout); //Set Primitive Topology context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST); if (mFirstRun) { // context->CopyResource(Popy, PartVertBufferInit); context->IASetVertexBuffers(0, 1, &PartVertBufferInit, &stride, &offset); } else { context->IASetVertexBuffers(0, 1, &mDrawVB, &stride, &offset); } context->SOSetTargets(1, &mStreamOutVB, &offset); context->VSSetShader(Part_VSSO, NULL, 0); context->GSSetShader(Part_GSSO, NULL, 0); context->PSSetShader(NULL, NULL, 0); //context->PSSetShader(Part_PS, NULL, 0); ID3D11DepthStencilState* depthState;//disable depth D3D11_DEPTH_STENCIL_DESC depthStateDesc; depthStateDesc.DepthEnable = false; depthStateDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO; device->CreateDepthStencilState(&depthStateDesc, &depthState); context->OMSetDepthStencilState(depthState, 0); if (mFirstRun) { //mFirstRun; context->Draw(1, 0); mFirstRun = false; } else { context->DrawAuto(); } //} // done streaming-out--unbind the vertex buffer ID3D11Buffer* bufferArray[1] = { 0 }; context->SOSetTargets(1, bufferArray, &offset); // ping-pong the vertex buffers std::swap(mStreamOutVB, mDrawVB); // Draw the updated particle system we just streamed-out. //Create the Input Layout //device->CreateInputLayout(Partlayout, numElementsPart, Part_VS_Buffer- //>GetBufferPointer(), // Part_VS_Buffer->GetBufferSize(), &PartVertLayout); //Set the normal Input Layout //context->IASetInputLayout(PartVertLayout); context->IASetVertexBuffers(0, 1, &mDrawVB, &stride, &offset); ZeroMemory(&depthStateDesc, sizeof(depthStateDesc)); depthStateDesc.DepthEnable = true; depthStateDesc.DepthWriteMask = D3D11_DEPTH_WRITE_MASK_ZERO; device->CreateDepthStencilState(&depthStateDesc, &depthState); context->OMSetDepthStencilState(depthState, 0); //I tried add normal layout here the same like Entry SO but no changes //Set Primitive Topology //context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_POINTLIST); context->VSSetShader(Part_VS, NULL, 0); context->GSSetShader(Part_GS, NULL, 0); context->PSSetShader(Part_PS, NULL, 0); context->DrawAuto(); //mFirstRun = true; context->GSSetShader(NULL, NULL, 0); } void ParticleSystem::RenderParticles() { //mFirstRun = true; LoadDataParticles(); } And the code of shaders: VertexShader to stream out struct Particle { float3 InitPos : POSITION; float3 InitVel : VELOCITY; float Age : AGE; //uint Type : TYPE; }; Particle main(Particle vin) { return vin;// just push data into geomtrywithso } GeometrywithSo struct Particle { float3 InitPos : POSITION; float3 InitVel : VELOCITY; float Age : AGE; //uint Type : TYPE; }; float RandomPosition(float offset) { float u = Time + offset;// (Time + offset); float v = ObjTexture13.SampleLevel(ObjSamplerState, u, 0).r; return (v); } [maxvertexcount(6)] void main( point Particle gin[1], inout PointStream< Particle > Output ) { //gin[0].Age = Time; if ( StartPart == 1.0f ) { //if (gin[0].Age < 100.0f) //{ for (int i = 0; i < 6; i++) { float3 VelRandom; //= 5.0f * RandomPosition((float)i / 5.0f); VelRandom.y = 10.0f+i; VelRandom.x = 35 * i* RandomPosition((float)i / 5.0f);//+ offse; VelRandom.z = 10.0f;//35*i * RandomPosition((float)i / 5.0f); Particle p; p.InitPos = VelRandom;//float3(0.0f, 5.0f, 0.0f); //+ VelRandom; p.InitVel = float3(10.0f, 10.0f, 10.0f); p.Age = 0.0f;//VelRandom.y; //p.Type = PT_FLARE; Output.Append(p); } Output.Append(gin[0]); } else if (StartPart == 0.0f) { if (gin[0].Age >= 0) { Output.Append(gin[0]); } } } If I change Age in geometry with so: for example Age += Time from const buffer In geometry shader its fine once but in draw shader it is 0 and next time if it is reading in geometry with so it is 0 too. Vertex shader to draw struct VertexOut { float3 Pos : POSITION; float4 Colour : COLOR; //uint Type : TYPE; }; struct Particle { float3 InitPos : POSITION; float3 InitVel : VELOCITY; float Age : AGE; // uint Type : TYPE; }; VertexOut main(Particle vin) { VertexOut vout; float3 gAccelW = float3(0.0f, -0.98f, 0.0f); float t = vin.Age; //float b = Time/10000; // constant Acceleration equation vout.Pos = vin.InitVel+ (0.7f * gAccelW)*Time/100; //vout.Pos.x = t; vout.Colour = float4(1.0f, 0.0f, 0.0f, 1.0f); //vout.Age = vout.Pos.y; //vout.Type = vin.Type; return vout; } Geometry shader to change point into line struct VertexOut { float3 Pos : POSITION; float4 Colour : COLOR; //uint Type : TYPE; }; struct GSOutput { float4 Pos : SV_POSITION; float4 Colour : COLOR; //float2 Tex : TEXCOORD; }; [maxvertexcount(2)] void main( point VertexOut gin[1], inout LineStream< GSOutput > Output ) { float3 gAccelW = float3(0.0f, -0.98f, 0.0f); //if (gin[0].Type != PT_EMITTER) { float4 v[2]; v[0] = float4(gin[0].Pos, 1.0f); v[1] = float4((gin[0].Pos + gAccelW), 1.0f); GSOutput gout; [unroll] for (int i = 0; i < 2; ++i) { gout.Pos = mul(v[i], WVP);// mul(v[i], gViewProj); gout.Colour = gin[0].Colour; Output.Append(gout); } } } And pixel Shader struct GSOutput { float4 Pos : SV_POSITION; float4 Colour : COLOR; }; float4 main(GSOutput pin) : SV_TARGET { return pin.Colour; }
  20. I'M interested in programming tools (For animation, UI, etc). Can anyone suggest me the resources where I can start learning or which technologies I need achive it. Thanks, Rakshit
  21. Dear Colony Managers, prepare yourselves to build some beautiful ocean districts for your people! In addition there are loads of detail improvements that give the overall playability a huge boost! Mostly based on testing and your highly appreciated feedback. Special thanks to Johannes for improving our german translation! TL;DR Display info icons during colony placement Trade discounts and surcharges Ocean district UI improvements for research, colony shares and workshop List of gameplay improvements New rendering system for buildings and world objects Colony Placement Placing a new colony or frontier building now displays icons on the surrounding fields. The represent the quality of the area by highlighting deserts, fields with high fertility, fossil or rare resources and more. Trade Discounts The price of resources and items always depends on who you are trading with. Space merchants and tech traders will charge a fee that makes buying more expensive and selling less lucrative. Natives and midras on the other side don’t know a lot about space market prices and often sell stuff very cheap. Other colonists, finally, link their pricing to your diplomatic relation. This means it can be very powerful to have a good relation towards another company. Ocean District This new district is now made available in the Lorian mission. The ocean district can be built on coast fields and the open sea. Districts have to be linked to others who connect with the shore. Microplastic collectors clean the seas and recover goods by filtering floating plastic, other waste and impurities from the water. Ocean thermal energy conversion uses the temperature difference between cooler deep sea and warmer surface water to meet part of the energy demand. UI Improvements Research Only display elements of buildings that are already available (the buildings don’t have to be licensed, though) Highlight research options by improved category: energy, food, goods, income, emissions Colony Share Trading Take-over of a city no longer needs at least 50% of shares Clearly display the player’s stake in another colony Tooltip with transaction fee and expected dividend Workshop Unite different item categories in single panel with scroll bars Other UI Stuff Added „mission failed“ dialog to competitions Highlight when an opposing faction is almost winning the competition „Back“ buttons in game are now called „resume game“ to make it more clear Infrastructure buildings now have gray icons Gameplay In competition and free play other factions will no longer wait until you have placed your first city center Forests and other plants regrow much faster now after being harvested or burning Nitroskirlid-pumpkins grow bigger in most areas now Increased number of default tech licenses in competition and free play Graphics & Tech We have completely rewritten our rendering system for buildings and other world objects: Improved render performance Much nicer animations More powerful particle effects
  22. Jack Slink

    Need Feedback on Game

    today i've finished working on PNR alpha and sharing it with you guys. main reason for sharing in this early stage of development, is to get feedback about what you'd like to see in it in the future etc. link: https://katabunaga.itch.io/pnr-alpha-v010
  23. Hey all, I just wanted to share a VS extension. It's useful for other people who are debugging multiple processes (aka server, player1, player2) with breakpoints that will break across those processes. It just puts up a (user defined sized) label in your window telling you which process the debugger dropped into. It's simple, but useful for rapid fire debugging for multiple processes to make it obvious that process you broke in. Just put some cookie text in your command lines and configure it from View -> Other Windows -> Process Hint. https://marketplace.visualstudio.com/items?itemName=gthomson.ProcessHint Feedback or questions welcome.
  24. I am trying to setup the custom wizard for making a 3ds MAX 2018 plug-in (to export a character animation data), but I can't locate the wizard file folder to put the .vsz file in. In the 3ds MAX 2018 docs, it only mentions where the folder is in VS 2015 (VC/vcprojects). It's a VC++ project, but I don't see any folder in VC for the wizard files. I'm using VS 2017 update 15.5.6 Enterprise, and the folders in VC are: Auxiliary, Redist and Tools. Thanks.
  25. Hi all, I have written a nice(ish) looking game of solitaire in Windows Forms, using VB.NET and Visual Studio 2015. It allows the player to play the game, and if their score is in the top 10, it saves the username and score o a leaderboard (saved in a text file so it is non-volatile). My next goal is to let the user know if the hand they are dealt is playable, but I'm not sure on the most efficient way of achieving this. I'm working on time complexity over space complexity! It's a simple game to code, but not an easy one to find the solution. Do you know of any algorithms that may achieve this goal that I would be able to look at?
  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!