hlsl

VS2010 - HLSL Intellisense?

試著忘記壹切 提交于 2019-12-01 03:07:27
Are there any free components out there that will give highlighting and/or intellisense for HLSL? I've seen mentions of something called "InteliSense.Net," but the author's site is down and I can't find a download anywhere. Not a direct answer to your question, but this is what I do to solve the same problem: I set Visual Studio to open *.fx files in Notepad++. (Right click the file, Open With, Add Notepad++, Set Default). Of course, you can use any editor you like. I use a HLSL syntax highlighting file for Notepad++ that I found on Google. I think it's this one . And finally, I keep this MSDN

VS2010 - HLSL Intellisense?

谁都会走 提交于 2019-11-30 23:17:46
问题 Are there any free components out there that will give highlighting and/or intellisense for HLSL? I've seen mentions of something called "InteliSense.Net," but the author's site is down and I can't find a download anywhere. 回答1: Not a direct answer to your question, but this is what I do to solve the same problem: I set Visual Studio to open *.fx files in Notepad++. (Right click the file, Open With, Add Notepad++, Set Default). Of course, you can use any editor you like. I use a HLSL syntax

FXC : error X3501: 'main': entrypoint not found

若如初见. 提交于 2019-11-30 19:25:59
I am following an example book called: Introduction to 3D Game Programming with DirectX 11 It is all written in VS2010. I would like to try using VS2013... It is an example project for Windows Desktop Program I have a program with the following in it (including some other files as part of common use): color.fx //*************************************************************************************** // color.fx by Frank Luna (C) 2011 All Rights Reserved. // // Transforms and colors geometry. //*************************************************************************************** cbuffer

What kind of blurs can be implemented in pixel shaders?

巧了我就是萌 提交于 2019-11-30 08:34:38
问题 Gaussian, box, radial, directional, motion blur, zoom blur, etc. I read that Gaussian blur can be broken down in passes that could be implemented in pixel shaders, but couldn't find any samples. Is it right to assume that any effect that concerns itself with pixels other than itself, can't be implemented in pixel shaders? 回答1: You can implement everything, as long you are able to pass information to the shader. The trick, in this cases, is to perform a multiple pass rendering. The final

Efficient pixel shader sum of all pixels

£可爱£侵袭症+ 提交于 2019-11-30 04:17:42
问题 How can I efficiently calculate the sum of all pixels in an image, by using a HSLS pixel shader? I'm interested in Pixel Shader 2.0, that I could invoke as a WPF shader effect. 回答1: There is a much simpler solution that doesn't use shaders: load the image as a texture, create a mipmap chain and read back the value of the last mipmap (1x1 pixel). This trick is used in games extensively to calculate, for example, the average brigthness of a scene (in order to apply HDR tonemapping). It's a

Pixel Shader Effect Examples

不羁岁月 提交于 2019-11-30 03:57:17
I've seen a number of pixel-shader effect examples, stuff like swirl on an image. But I'm wondering if anyone knows of any examples or tutorials for more practical uses of shader effects? I'm not saying that a swirl effect doesn't have it's uses, it's just that many of the examples I've found have the basic effect explained and don't go into how it might be used subtly with another effect or transition to produce a wonderful effect. There's a video here , that outlines all the WPF Effects Library, but I'm not sure how I would use some of them in a practical context. For example, when Flash 8

How do I calculate pixel shader depth to render a circle drawn on a point sprite as a sphere that will intersect with other objects?

情到浓时终转凉″ 提交于 2019-11-30 03:24:14
I am writing a shader to render spheres on point sprites, by drawing shaded circles, and need to write a depth component as well as colour in order that spheres near each other will intersect correctly. I am using code similar to that written by Johna Holwerda : void PS_ShowDepth(VS_OUTPUT input, out float4 color: COLOR0,out float depth : DEPTH) { float dist = length (input.uv - float2 (0.5f, 0.5f)); //get the distance form the center of the point-sprite float alpha = saturate(sign (0.5f - dist)); sphereDepth = cos (dist * 3.14159) * sphereThickness * particleSize; //calculate how thick the

HLSL for getting cylinder effect

[亡魂溺海] 提交于 2019-11-29 12:16:58
I need to write an application with Silverlight 4 and need to show images like wrapped on cylinder. I need some HLSL code, as I wont to do that with Effects of Silverlight. I don't wont to do that with 3D libarries for silverlight. I only need HLSL code for changing pixels. I need for my image to look like this Thanks. This seems to be the effect you want, you may wish to change the 0.2 value to increase or decrease the effect or make this adjustable in your shader but that's a simple change to do. I'd recommend Shazzam if your not using it for writing shaders for WPF or Silverlight. sampler2D

Storing two float values in a single float variable

試著忘記壹切 提交于 2019-11-29 07:09:32
I'd like to store two float values in a single 32 bit float variable. The encoding will happen in C# while the decoding is to be done in a HLSL shader. The best solution I've found so far is hard-wiring the offset of the decimal in the encoded values and storing them as integer and decimal of the "carrier" float: 123.456 -> 12.3 and 45.6 It can't handle negative values but that's ok. However I was wondering if there is a better way to do this. EDIT: A few more details about the task: I'm working with a fixed data structure in Unity where the vertex data is stored as floats. (Float2 for a UV,

How much performance do conditionals and unused samplers/textures add to SM2/3 pixel shaders?

痴心易碎 提交于 2019-11-28 18:56:25
We've one pixel shader in HLSL which is used for slightly different things in a few places, and as such has several conditional blocks meaning that complex functionality is omitted in some cases. As well, this means we pass textures as sampler parameters which may not always be used. I have no idea how much of a performance hit these two things add but especially since we support SM2.0 on integrated graphics chips, inefficiencies are an issue. So, does passing a texture in and not using it mean any extra overhead? And does using an if simply act to add a couple of instructions or can it