Jump to content
  • Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

2317 Excellent

About KaiserJohan

  • Rank

Personal Information

  • Role
  • Interests

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hello, I'm doing tessellation and while I got the positions setup correctly using quads I am at a loss how to generate smooth normals from them. I suppose this should be done in the Domain shader but how would this process look like? I am using a heightmap for tessellation but I would rather generate the normals from the geometry than use a normal map, if possible. Cheers
  2. I know this might come of as ranting but I recently came back from being a relatively active poster/browser and in my humble opinion navigation has become strictly worse in every regards. I remember a more clean and neat design, it's difficult to find the usual forums I look at and theres ads everywhere. What happened?
  3. KaiserJohan

    Strange tessellation pattern

    Still wierd sadly. Must be something wrong with the shaders but I cant figure out why? The vertex/index buffers must be legit as per first screenshot is fine...
  4. Am trying a basebones tessellation shader and getting unexpected result when increasing the tessellation factor. Am rendering a group of quads and trying to apply tessellation to them. OutsideTess = (1,1,1,1), InsideTess= (1,1) OutsideTess = (1,1,1,1), InsideTess= (2,1) I expected 4 triangles in the quad, not two. Any idea of whats wrong? Structs: struct PatchTess { float mEdgeTess[4] : SV_TessFactor; float mInsideTess[2] : SV_InsideTessFactor; }; struct VertexOut { float4 mWorldPosition : POSITION; float mTessFactor : TESS; }; struct DomainOut { float4 mWorldPosition : SV_POSITION; }; struct HullOut { float4 mWorldPosition : POSITION; }; Hull shader: PatchTess PatchHS(InputPatch<VertexOut, 3> inputVertices) { PatchTess patch; patch.mEdgeTess[ 0 ] = 1; patch.mEdgeTess[ 1 ] = 1; patch.mEdgeTess[ 2 ] = 1; patch.mEdgeTess[ 3 ] = 1; patch.mInsideTess[ 0 ] = 2; patch.mInsideTess[ 1 ] = 1; return patch; } [domain("quad")] [partitioning("fractional_odd")] [outputtopology("triangle_ccw")] [outputcontrolpoints(4)] [patchconstantfunc("PatchHS")] [maxtessfactor( 64.0 )] HullOut hull_main(InputPatch<VertexOut, 3> verticeData, uint index : SV_OutputControlPointID) { HullOut ret; ret.mWorldPosition = verticeData[index].mWorldPosition; return ret; } Domain shader: [domain("quad")] DomainOut domain_main(PatchTess patchTess, float2 uv : SV_DomainLocation, const OutputPatch<HullOut, 4> quad) { DomainOut ret; const float MipInterval = 20.0f; ret.mWorldPosition.xz = quad[ 0 ].mWorldPosition.xz * ( 1.0f - uv.x ) * ( 1.0f - uv.y ) + quad[ 1 ].mWorldPosition.xz * uv.x * ( 1.0f - uv.y ) + quad[ 2 ].mWorldPosition.xz * ( 1.0f - uv.x ) * uv.y + quad[ 3 ].mWorldPosition.xz * uv.x * uv.y ; ret.mWorldPosition.y = quad[ 0 ].mWorldPosition.y; ret.mWorldPosition.w = 1; ret.mWorldPosition = mul( gFrameViewProj, ret.mWorldPosition ); return ret; } Any ideas what could be wrong with these shaders?
  5. KaiserJohan

    StructuredBuffer and matrix layout

    Sorry for bump but I just stumbled upon this recently. Was frustrated as I already had my matrices column-major when sending to the shader so I couldn't understand why it got sampled transposed. I just transposed() the matrix after sampling in the shader.
  6. I need to bind a shader resource as a structured buffer. Textures (t#) and constant buffers (b#) are listed as expected but not StructuredBuffers? I've looked at https://msdn.microsoft.com/en-us/library/windows/desktop/dd607359(v=vs.85).aspx and it still puzzles me - what is the register type used for Structured Buffers in HLSL?
  7. Just a really quick question - is there any overhead to using DrawIndexedInstanced even for geometry you just render once vs using DrawIndexed? Or is the details obfuscated by the graphics driver? I would assume no but you never know
  8. KaiserJohan

    Terrain tessellation and frustum culling

      Makes sense. The 'BoundsY' for a quad is calculated on the CPU once by reading the heightmap and making an AABB? Can this be used in conjunction with other terrain tessellation alghorithms (like http://www.frostbite.com/wp-content/uploads/2013/05/adaptive_terrain_tessellation.pdf)?
  9. So I'm trying to implement terrain tessellation. I suppose it should be as simple as draw an enormous quad patch, generate new vertices and then offset the y-coordinate using a heightmap. Am I correct that far? :) What I'm curious is how do you perform any form of culling of the terrain geometry at this point. Say only a small part of this large quad is visible, how do you prevent it from tessellating alot of soon-to-be-unused vertices?
  10. As the title says :) Using my mouse, I want to pick out a texel on a mesh I have rendered and modify that texel. I start by picking a screen coordinate using my mouse. I then convert this screen coordinate to a world coordinate (using depth value at that pixel + inverse wvp matrix). This world coordinate is on the mesh at the pixel of the texture I want to modify. The question is how do I then go from world coordinate to texture coordinate on that specific texture?
  11. KaiserJohan

    Custom world editor?

      Great post. I'm at the point where I extracted world pos successfully, the question is how do I obtain heigthmap coords from that?
  12. KaiserJohan

    Reading one texel from depthbuffer

      almost sounds like a  raypick vs ground mesh problem.      It probably very much is :) do you have any light to shed on the subject?
  13. KaiserJohan

    Reading one texel from depthbuffer

    I do use the stencil buffer for reducing overdraw when doing point lights. 
  • 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!