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 62 results

  1. 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.
  2. 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!
  3. 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
  4. 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.
  5. 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!
  6. 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
  7. 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).
  8. 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
  9. 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.
  10. 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.
  11. 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; }
  12. 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
  13. 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
  14. 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
  15. 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.
  16. 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.
  17. Toxic_Obsidian

    Visual Studio TGUI Project LOG -Day2

    Oops,today i'm so sad. Because our computer classroom was requisitioned because of the "THUSSAT" examination. And i have to move my projects to our e-book lyceum , and there's no Visual Studios installed. Perhaps i have to pause my project for one day. Unfavorable... Hope it won't take too much time.
  18. Toxic_Obsidian

    C++ TGUI Project Start -Day1

    So , today i came up with a new idea of "Make a GUI Lib with DirectX 9.0" . I've prepared DirectX 9 SDK (June 2010) and Visual Studio 2010. The reason of using DX9 is that i want my lib compatible with Windows XP(because my stubborn computer classroom admin thought that WinXP might accelerate the process , and never update our hardware). So far i've already learnt D3D (by self-study) and a little bit of Win32. I hope i can do that.
  19. I know vertex buffer is just another GPU resource represented by ID3D12Resource, but why is it said that vertex buffer don’t need a descriptor heap?? Other resources like depth/stencil resource, swap chain’s buffer need to have descriptor heaps. How does these resources differ from vertex buffer.
  20. I want to output the Image file from the shaderresourceview of the rendertexture, so I have to transfer the shaderresourceview into a image object, and I don't know how to do this. Could you help me with it? PS:I am using SharpDx to develop my program. So it's better be coding by C#. Many thanks.
  21. Is there any way to know the active solution configuration using a build macro? I know $(Configuration) is for active project configuration but I can't find one for active solution
  22. I've been away for a VERY long time, so if this topic has already been discussed, I couldn't find it. I started using VS2017 recently and I keep getting warnings like this: 1>c:\program files (x86)\microsoft directx sdk (june 2010)\include\d3d10.h(609): warning C4005: 'D3D10_ERROR_FILE_NOT_FOUND': macro redefinition (compiling source file test.cpp) 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.16299.0\shared\winerror.h(54103): note: see previous definition of 'D3D10_ERROR_FILE_NOT_FOUND' (compiling source file test.cpp) It pops up for various things, but the reasons are all the same. Something is already defined..... I have DXSDK June2010 and referencing the .lib and .h set correctly (otherwise I wouldn't get this, I'd get errors) Is there a way to correct this issue or do I just have to live with it? Also (a little off-topic) the compiler doesn't like to compile my code if I make very small changes.... What's up with that? Can I change it? Google is no help.
  23. I'm not sure if this is the right place for this question, but I'll give it shot Using Visual Studio Code, I have the task.json set up to launch a batch file that is set up like follow: @echo off call "Z:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x86 set INC_PROJECT_PATH="Z:\Asus\Documenti\VS Code\Projects\Packman Clone 1" set INC_SDL_PATH="Z:\Dependencies\SDL2-2.0.5\SLD2" set SOURCE1_PATH="Z:\Asus\Documenti\VS Code\Projects\Packman Clone 1\source\*.cpp" set SOURCE2_PATH="Z:\Asus\Documenti\VS Code\Projects\Packman Clone 1\Engine\*.cpp" set LIB_SDL_PATH="Z:\Dependencies\SDL2-2.0.5\lib\x86" set OUTPUT_PATH="Z:\Asus\Documenti\VS Code\Projects\Packman Clone 1\Debug\Pacman.exe" cl /std:c++latest /W4 /ZI ^ /I %INC_SDL_PATH% /I %INC_PROJECT_PATH% ^ /EHsc %SOURCE1_PATH% %SOURCE2_PATH% ^ /link /SUBSYSTEM:CONSOLE ^ /LIBPATH:%LIB_SDL_PATH% SDL2main.lib SDL2.lib ^ /out:%OUTPUT_PATH% I'm not totally sure about what it's doing and I'm piecing it togeter as I go (trial and error + google), so if I got it right, the *.cpp at the end of those paths, it means that every time I build it will build all the .cpp that it finds in those 2 paths. And that doesn't sounds good, so I was wondering, there is a way to tell it to re-compile only the files that have changed?
  24. Currently, our framework only supports loading binary shader code. The way we do it in Visual Studio is through custom build tool per shader file. Now we also want to support shader recompilation when a user presses some key. This is tricky since now we don't have access to the source files. So I was thinking, if there is some way to export all the commands from the custom build tool to a text file, then we can just load that text file and execute all commands inside and then just do the regular shader loading as we do it right now. Example custom build tool command for a shader which has vertex, pixel, and geometry shader stages: fxc %(Identity) /E VSMain /T vs_5_0 $(HLSLCompileFlags) /Fo %(Identity)\..\Binary\%(Filename).vert.bin fxc %(Identity) /E PSMain /T ps_5_0 $(HLSLCompileFlags) /Fo %(Identity)\..\Binary\%(Filename).frag.bin fxc %(Identity) /E GSMain /T gs_5_0 $(HLSLCompileFlags) /Fo %(Identity)\..\Binary\%(Filename).geom.bin So here is the process- - Run custom build rules for the shader files - In post-build event of the project, collect all these custom build tool commands and dump them to a text file - Now if user wants to recompile, just load this text file and execute all commands inside How would I get access to these custom build tool commands in the post-build event?
  25. Vilem Otte

    Ludum Dare 40

    Since Ludum Dare 35 I'm regularly participating in every one of them and this one wasn't exception. My release thoughts are positive - this time I've again worked with one friend (with whom we've worked also in the past on Ludum Dare), and I enjoyed it a lot. As this is not a post mortem yet, I will not go into details what went right or wrong - meanwhile I'll just show the results and put out few notes... Yes, that's one of the screenshots from the game (without UI). I'm using this one as a "cover" screenshot - so it should also be included here. Anyways this was my another experience with Unity and maybe one of the last Ludum Dare experiences with it. While I do like it, if I can think about suitable game for my own game engine for the theme next time, it's possible that I won't use Unity next time. Ludum Dare Each 4 months or so, this large game jam happens. It's a sort of competition, well... there are no prizes, and I honestly do it just for fun (and to force myself to do some "real" game development from time to time). It takes 48 or 72 hours to create your game (depending on whether you go for compo or jam category), and there are just few basic rules (which you can read on site - https://ldjam.com/). Then for few weeks you play and rate other games, and the more you play, the more people will play and rate your game. While ratings aren't in my opinion that important, you get some feedback through comments. Actually I was wrong about no prizes - you have your game and feedback of other people who participate in Ludum Dare as a prize. Unity... I've used Unity for quite long time - and I have 2 things to complain about this time, majority of all used shaders in Air Pressure (yes, that is the game's name) are actually custom - and I might bump into some of them in post mortem. Unity and custom shaders combination is actually quite a pain, especially compared to my own engine (while it isn't as generic as Unity is - actually my engine is far less complex, and maybe due to that shader editing and workflow is actually a lot more pleasant ... although these are my own subjective feelings, impacted by knowing whole internal structure of my own engine in detail). Second thing is particularly annoying, related to Visual Studio. Unity extension for Visual Studio is broken (although I believe that recent patch that was released during the Ludum Dare fixed it - yet there was no time for update during the work), each time a C# file is created, the project gets broken (Intellisense works weird, Visual Studio reports errors everywhere, etc.), the only work around was to delete the project files (solution and vcxproj) and re-open Visual Studio from Unity (which re-created solution and vcxproj file). Unity! On the other hand, it was good for the task - we finished it using Unity, and it was fun. Apart from Visual Studio struggles, we didn't hit any other problem (and it crashed on us just once - during whole 72 hours for jam - once for both of us). So I'm actually quite looking forward to using it next time for some project. Anyways, I did enjoy it this time a lot, time to get back into work (not really game development related). Oh, and before I forget, here they are - first gameplay video and link to the game on Ludum Dare site: https://ldjam.com/events/ludum-dare/40/air-pressure PS: And yes I've been actually tweeting progress during the jam, which ended up in a feeling, that I've probably surpassed number of Tweets generated by Donald Trump in past 3 days.
  • 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!