Jump to content
  • Advertisement

Doggolainen

Member
  • Content Count

    41
  • Joined

  • Last visited

Community Reputation

115 Neutral

About Doggolainen

  • Rank
    Member

Personal Information

  • Interests
    Business
    Production
    Programming
  1. Hi, I wish to generate light map textures for objects in my scene containing ambient occlusion and global illumination. Currently I can do this in 3D Max, but it is taking too long on my single computer for this to be feasible. Does anyone know any rendering farms that supports this (light baking)? I checked "Rebusfarm" and they did not support this feature. Any help appreciated, Doggolainen
  2. Doggolainen

    Sampler not working outside pixelshader

    Thank you so much! It works now. I was so busy binding the actual samplers that I forgot to bind the textures!!! Thanks again <3
  3. Hello, I am, like many others before me, making a displacement map tesselator. I want render some terrain using a quad, a texture containing heightdata and the geometryshader/tesselator. So far, Ive managed the utilize the texture on the pixelshader (I return different colors depending on the height). I have also managed to tesselate my surface, i.e. subdivided my quad into lots of triangles . What doesnt work however is the sampling step on the domain shader. I want to offset the vertices using the heightmap. I tried calling the same function "textureMap.Sample(textureSampler, texcoord)" as on the pixelshader but got compiling errors. Instead I am now using the "SampleLevel" function to use the 0 mipmap version of the input texture. But yeah non of this seem to be working. I wont get anything except [0, 0, 0, 0] from my sampler. Below is some code: The working pixelshader, the broken domain shader where I want to sample, and the instanciations of the samplerstates on the CPU side. Been stuck on this for a while! Any help would be much appreciated! Texture2D textureMap: register(t0); SamplerState textureSampler : register(s0); //Pixel shader float4 PS(PS_IN input) : SV_TARGET { float4 textureColor = textureMap.Sample(textureSampler, input.texcoord); return textureColor; } GS_IN DS(HS_CONSTANT_DATA input, float3 uvwCoord : SV_DomainLocation, const OutputPatch<DS_IN, 3> patch) { GS_IN output; float2 texcoord = uvwCoord.x * patch[0].texcoord.xy + uvwCoord.y * patch[1].texcoord.xy + uvwCoord.z * patch[2].texcoord.xy; float4 textureColor = textureMap.SampleLevel(textureSampler, texcoord.xy, 0); //fill and return output.... } //Sampler SharpDX.Direct3D11.SamplerStateDescription samplerDescription; samplerDescription = SharpDX.Direct3D11.SamplerStateDescription.Default(); samplerDescription.Filter = SharpDX.Direct3D11.Filter.MinMagMipLinear; samplerDescription.AddressU = SharpDX.Direct3D11.TextureAddressMode.Wrap; samplerDescription.AddressV = SharpDX.Direct3D11.TextureAddressMode.Wrap; this.samplerStateTextures = new SharpDX.Direct3D11.SamplerState(d3dDevice, samplerDescription); d3dDeviceContext.PixelShader.SetSampler(0, samplerStateTextures); d3dDeviceContext.VertexShader.SetSampler(0, samplerStateTextures); d3dDeviceContext.HullShader.SetSampler(0, samplerStateTextures); d3dDeviceContext.DomainShader.SetSampler(0, samplerStateTextures); d3dDeviceContext.GeometryShader.SetSampler(0, samplerStateTextures);
  • Advertisement
×

Important Information

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

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

Sign me up!