• Advertisement
  • Popular Tags

  • Popular Now

  • Advertisement
  • Similar Content

    • By isu diss
      How do I fill the gap between sky and terrain? Scaling the terrain or procedural terrain rendering?

    • By lucky6969b
      I've finished a class that can generate textures using the perlin noise function on the fly. The texture may be 2D or 3D. Also, I've seen a guy who can generate vector fields using perlin noise, but the problem is, when you do iterations to the 3D environment, you just have one value to turn, which is a scalar perhaps, and you want to do three things (yaw, pitch and roll), is it possible to generate a 3D vector field using the 3D perlin noise function?
    • By Cahit Karahan

      Hi, I'm new in this forum. It is honorable to see such communities exist. I would like to share my new game. I did for android with unity. I know the game is a little awkward , but you have to know that this game is from the time when Unity's name is Unity3D  I have made my first game when I was 12. Now I am 22.  I have taken a lot of experience in this process and I can make better games nowadays. I have published this game nowadays but actually this game is very old but also it is very special for me :))
      I have just wanted to retouch and share this game, because it has a very important place for me.

      It's a special free 3D horror adventure action game for the halloween. Fun with scary sound effects and musics, 3D realistic graphics, you will feel the horror in the deep of your heart. Use your reflex. Totally free adventure. Totally scary horror game. 

      Tamarra, she is a beast from our world. She needs to consume souls from innocent people to stay alive. Story begins, the old Elaris tribe had lost their everything because of this beast who lived in the well. Araknas was the most powerful warrior of the tribe. One day, Araknas's mother was killed by the servant beasts of Tamarra. That's how Araknas's journey to the well begins. Tamara's well is guarded by horrible beasts. Araknas has to pass all servant beasts until he reaches Tamarra.

      Even death at the end is worth the revenge. 
      Are you brave enough to jump into Tamarra's well?

      Survive from witch attacks, clown attacks and many scary creature.

      - Realistic 3D graphics.
      - Scary sounds.
      - Scary musics.
      - Best experience with headphones.
      - A demon cage where you can imprison all the demons one by one
      - The witches do not like help, but they love blood stone. Witch store where you can develop your abilities and get new abilities.
      - Countless beasts.
      - At the end of the well there is a hidden surprise for you.

      *We do not recommend this game to people with clown phobia, spider phobia, or panic attacks.*

      **!!!**Note : This game is an early-access game, we are upgrading new features every day, new beasts, new improvements, as an example online 1vs1 fall on the list, so stay on connect and follow Halloween : Horror Well on Google Play.**!!!**

    • By BigJiggly
      Hello! So, I've been the leader of BJP for a while now. I'm a bit bored of taking the role I always take, leader. I was hoping someone out there is looking to forge a team maybe and needs a programmer. 
      I have experience mainly in the Unity engine(C# intermediate) and I have a very small amount of knowledge on Shaders, as well as experience on developing games(usually end up stuck in dev hell) and leading experience from my last team which at one point reached 11 people. I personally love the Unity engine and prefer to use it as it's the development environment I'm comfortable with. 
      I have used Unity for over a year and a few months, I'd consider myself an intermediate at the Engine, but to this day Unity still surprises me. 
      I live in the United Kingdom, I find it a bit strange to work with other programmers as the ones I've worked with tend to leave their code heavily unoptimised and I'm a on the go optimise kind of guy, I also like to get things done quickly.
      If you're a new team and need a programmer that has high levels of ambition and strives to maintain the motivation throughout the team, then I'm your guy. I don't care if you're just beginning because I'm all for helping people learn!
      To finish this off: I like to get things done and I like to get them done right the first time, if I fail I will do it again and again, etc, until I loose all motivation. So if you're a modeller or an artist, please don't leave me to do all the modelling/art as well as the programming and sound. I do have experience in all those areas but my main power is in programming and I'd prefer to keep it that way.
      [If this was posted in the wrong forum, sorry, I don't really know the layout of this website yet]
    • By 51mon
      I'm dealing with ribbons following the shape of multiple spline segments. It's straightforward to compute the direction at any point along the spline. However the ribbon also got a flat shape and I'm struggling with finding a way to compute the angle of the ribbon in the plane perpendicular to the direction.
      To illustrate what I mean here's a piece of code that almost worked:
      float3x3 rotMtxFromSpline; rotMtxFromSpline[1] = normalize(splineDir); rotMtxFromSpline[0] = normalize(cross(float3(1, 0, 0), rotMtxFromSpline[1])); rotMtxFromSpline[2] = cross(rotMtxFromSpline[0], rotMtxFromSpline[1]); // Rotate rotMtxFromSpline[0] in the rotMtxFromSpline[0]-rotMtxFromSpline[2]-plane to align with float3(0, 0, 1) dir rotMtxFromSpline[0] = normalize(dot(rotMtxFromSpline[0], float3(0, 0, 1)) * rotMtxFromSpline[0] + dot(rotMtxFromSpline[2], float3(0, 0, 1)) * rotMtxFromSpline[2]); rotMtxFromSpline[2] = cross(rotMtxFromSpline[0], rotMtxFromSpline[1]); The problem with this code is when the spline segment becomes perpendicular to (0,0,1)-dir as the orientation switch from one side to the other very easily.
      The approach above is kind of a global approach and I'm thinking if there's a way to append some info to each spline segment to remedy the issue.
      Anyhow I wanted to post this question in case anyone had a similar problem that they solved or maybe anyone know some web resource dealing with this issue?
  • Advertisement
  • Advertisement

DX12 [D3D12 SOLVED] Could not render triangles, no error output (debug enabled)

Recommended Posts

Hi everyone,

I am new to DX12, I download sample project from MSDN and it can run and draw triangles successfully.

But when I create new project and copy code from MSDN sample (Hello Triangles Project). I do not know why it could not render anything to screen except clearing the screen with blue color.

Could you have a look at my code to see what problem is... I got stuck here for 2 days.



Edited by VietNN

Share this post

Link to post
Share on other sites

One thing that stands out to me:

struct Vertex {
	XMFLOAT3 position;
	XMFLOAT4 color;

Here you have a float3 for position; which is matched by your input-signature declaration.

PSInput VSMain(float4 position : POSITION, float4 color : COLOR)
	PSInput result;

	result.position = position;
	result.color = color;

	return result;

But the Vertex-shader receives a float4. Even if this were technically legal (not sure in DX12), this probably means that the w-component is 0.0f, while it should actually be 1.0f when output from the vertex-shader w/o any persective transform, as is the case for you. I'd suggest trying:

PSInput VSMain(float3 position : POSITION, float4 color : COLOR)
	PSInput result;

	result.position.xyz = position;
        result.position.w = 1.0f;
	result.color = color;

	return result;

and see if this works.


Share this post

Link to post
Share on other sites

Where are you setting your viewport and scissor rectangle? (m_viewport and m_scissorRect)

This is exactly what happens when you copy from multiple sources and smash it all together without reading things through.

Anyway, it will work once you initialize those


Juliean is write about using a float3 instead of a float4. Weird enough though, the w component actually gets default initialized to 1.0f, and as Juliean mentioned you would have assumed it was being zero initialized, this is a good reason to be explicit

Share this post

Link to post
Share on other sites

First, I want to thank  iedoc and Juliean

That was my ridiculous mistake when quickly copy and paste

Actuallly, I was working on a bigger project, porting that project from D3D11 to D3D12 and met such an issue. Do not know why it could not render anything to screen. Because resource is huge, I can not upload it all here.

I am sure that I set m_viewport and m_scissorRect already on that project :). Here is my work:

- On init: (using commandlist 1, commandAllocator1)

     +Create Vertex buffer (default heap and upload heap)

     +Execute commandlist

     +Sleep(1000): maybe do not need but just to make sure init command was finished on GPU before render.

- On Render: (using commandlist 2, commandAllocator 2, same commandQueue)

      +Transition Vertex buffer from COPY_DEST to VERTEX_BUFFER

      +Transition backbuffer to PRESENT to RENDER_TARGET



      +SetViewport and scissor (sure it has value)

      +SetGraphicsRootSignature and PipelineState (using same root and pipeline as above example because I just want to draw triangle, VertexShader use position as float3 and inputlayout is float3 also)




      +Transition backbuffer to RENDER_TARGET to PRESENT

      +Execute commandlist


      +Update frame index

- I can see clear color, if I set clear color different each frame and set break point at present(), i can see it changed color each times but no triangles. Could you guys please show me if i miss any step.

Note: Sometimes, I can see that triangles blink at first launch and disappear.

Edited by VietNN

Share this post

Link to post
Share on other sites

I think I found problem with VertexBuffers, if I use a temp VertexBuffers it can draw. Need more time to investigate, thank you all :)

Edited by VietNN

Share this post

Link to post
Share on other sites

Thank you all, problem solved. I forgot the cull mode, using default rasterize state set cullmode to BACK. That make me can not draw anything

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement