Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / [STICKY] Learning to write Shaders

Author
Message
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 7th Jan 2010 12:22
Er? I was suggesting you hide all the OTHER objects before the final render just to be certain.

Quote: "An easy way to check is to hide all the other objects"


In other words:

1. hide object 200
2. show the scene objects
3. render the scene using the camera effect and camera
4. show object 200
5. hide all the scene objects
6. render camera 0

What do you see? Or is that what you've done already?
Weave
AGK Bronze Backer
18
Years of Service
User Offline
Joined: 26th Sep 2006
Location:
Posted: 7th Jan 2010 17:25 Edited at: 7th Jan 2010 17:32
Ok, have hidden all the objects and I see this(see attatched)

Only my character and a bumpmapped cube show up, tinged with blue. Oh and his reflection in the water, he is hidden when below the water whilst the camera is above and the cube is visible from inside the house when a wall is between the camera and it.

Attachments

Login to view attachments
Weave
AGK Bronze Backer
18
Years of Service
User Offline
Joined: 26th Sep 2006
Location:
Posted: 7th Jan 2010 21:53
Then I removed an other hide object 200(Quad) from after the sync and got this, there is a cloud in the water a bit like a moving dvorjak image that fades away a second later and varies when I set differing transparencies on the quad. Guess it shows something is going on.

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 8th Jan 2010 11:57
Quote: "Guess it shows something is going on."


Yes.

Unless your scene is meant to be very blue I'd guess that something has gone very wrong.

If you're using a demo similar to the one we discussed before Xmas then my guess is that you've hidden things in the wrong stage of your render cycle.

Could you post a step by step guide to your rendering sequence similar to the one I gave in my previous post? We can make progress then.
Weave
AGK Bronze Backer
18
Years of Service
User Offline
Joined: 26th Sep 2006
Location:
Posted: 8th Jan 2010 18:24 Edited at: 8th Jan 2010 18:36
Well at the moment it has this, but I see what you are getting at, as the water function ends asking to sync camera zero, but the code then asks to sync camera 3 and so hasnt got what the water function called to be drawn.(?)

1.Water Update
a. Fast syncs camera 1 for refraction
b. Fast syncs camera 2 for reflection (ends by calling sync mask 2^0)
2. Hides bloom Quad and fast syncs camera 3 for the bloom shader.
3. Shows bloom Quad and Syncs Camera 0

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Jan 2010 01:04
Quote: "but I see what you are getting at, as the water function ends asking to sync camera zero, but the code then asks to sync camera 3 and so hasnt got what the water function called to be drawn.(?)"


Yes.

You probably need to remove the first sync camera 0 step (i.e. the end of 1b in your outline) and let camera 3 do the final water render plus the bloom. Camera 0 should only be used for the final screen render - i.e. your step 3.
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 18th Jan 2010 16:23
Has any one managed to get vertex texture fetch working( tex2Dlod )?

Im currently trying to make some wavy water, but need vertex texture lookups to modify vertex height.

float height=tex2Dlod(Waterheight,float4(uv,0,0));
NewPos.y = NewPos.y + height * WaveHeight;

Seems to return 0
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 18th Jan 2010 16:29
I don't think you need tex2Dlod, the normal one should work fine. But be aware that it requires shader model 3, and that some older graphics card don't support it (even if they support shader 3).
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Jan 2010 16:46 Edited at: 21st Jan 2010 12:27
Quote: "Has any one managed to get vertex texture fetch working( tex2Dlod )?

Im currently trying to make some wavy water, but need vertex texture lookups to modify vertex height."


I don't think you can do it. This is what my copy of the DX9 SDK says:

Health warning: the SDK Help file seems to be wrong. See my post three posts further down.

Attachments

Login to view attachments
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 18th Jan 2010 19:03
After checking one of my old codes, it turns out that tex2Dlod is the way to go and works perfectly in the vertex shader. However, it was in XNA, so I don't know if DBPro supports it.
What graphics card do you have?

When I have some time, I'll see what I can do.
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 18th Jan 2010 19:49 Edited at: 18th Jan 2010 20:09
I have a gtx280,

After doing some research I think it only works with floating point textures particularly D3DFMT_A32B32G32R32F and D3DFMT_R16F, so Im testing it out now.

Edit:

Fail , looks like dbp dose not support vertex texture fetching
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 18th Jan 2010 23:00
Quote: "Fail , looks like dbp dose not support vertex texture fetching"


Yes it does. The attached demo using vertex texture fetch works fine for me. Just press b to increase the displacement on the sphere.

Looks like DBPro's Help files were written by the same person who wrote the MS DX9 SDK "Help" files.

The shader is a slightly edited version of one written by Wolfgang Engel. You'll need an SM3 capable card of course. The shader was edited and tested using Dark Shader.

Attachments

Login to view attachments
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 19th Jan 2010 12:02
Thx, GG

I manged to fix the problem, lol I was using the alpha channel in my shader but the height data was stored in r/g/b
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th Jan 2010 12:13
Ah. It's surprisingly hard to spot that kind of slip - it's all too easy to read what we intended to write not what we actually wrote.

Glad you got it sorted - and thanks for prompting me to have a closer look at SM3, it was long overdue.
EVOLVED
21
Years of Service
User Offline
Joined: 9th Feb 2003
Location: unknown
Posted: 21st Jan 2010 00:25 Edited at: 21st Jan 2010 00:27
Yeh, D`oh!

Sm3 extra instruction count can come in very handy if your interested here is a quick video off new displacement map water im working on Ocean Shader

Image, cus of poor video quality.

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 21st Jan 2010 12:25
Inspiring. Thank you.

You've convinced me that SM3 is the way to go for decent ocean breakers, etc. I'll abandon my earlier attempts and get some practice at this myself.

I guess the vertex texture fetches make the usual pixel shader bottlenecks less of a problem - as well as allowing you to do things that can't be done easily (or at all) in SM2.

Great to see you here again and hope to see more excellent demos.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 21st Jan 2010 15:50
Looks nice.

My signature is NOT a moderator plaything! Stop changing it!
Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 21st Jan 2010 15:55
Very nice Evolved. Congrats in such marbelous work. is this going to be released? or is something that you are keeping for you?.

This reminds me something GG was working on
Lemonade
15
Years of Service
User Offline
Joined: 10th Dec 2008
Location:
Posted: 25th Jan 2010 22:41
Amazing work Evolved. Glad to see you back in the community.

BTW, I would love to see a completed version of your Land Scape program!
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 26th Jan 2010 00:11 Edited at: 26th Jan 2010 02:57
@GG I've added normal mapping to your shadow shader/with alpha. I am having a few issues with it. I don't understand how you are calculating the depth. I thought all you did for depth was ouput the Z value to a texture. Your doing something I don't quite understand yet. Is there anyway to change this to something like -



I could be wrong but I think that would be a better way to go about it. I'm not really a master of shaders yet, but I'm getting much better.

I was wondering if you could explain in words, the step by step process that is happening with this shader. Well anyways any help would be very useful. If I didn't do the normal mapping correctly please feel free to adjust any bad code.

HERE IS THE SHADER:


Thanks for any help
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 26th Jan 2010 19:10
david w

Not sure about your suggestion. In what way would it be better?

Regarding your normal mapping problem, one obvious problem is that you've used the light position instead of the camera position in your calculation of the view vector in the vertex shaders.

Also, are you using a positional or directional light? (If I recall correctly I caused a bit of confusion on this point in my shadow mapping demo - but I thought I'd fixed it in the final version.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 26th Jan 2010 21:23
Ok I think I get what your saying I have to change lightPos to cameraPos. What is the easiest way to get cam pos into the shader? A new variable that you pass? or can it be extracted from the matrix data already present?

temp=mul(lightPos,winv)-In.pos;
Out.View=mul(temp,TSM);

Also Im using your latest version with the alpha mapped code. An I idea would be to use a colorkey instead of the alpha channel or DBP's transparency command. How would I do change it to a color key instead of alpha channel?
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 27th Jan 2010 01:19
Quote: "What is the easiest way to get cam pos into the shader?"


At the top of the shader code with the other quantities passed from DBPro (i.e. WorldViewProjection, etc) use either



or



and make sure the rest of the code matches.

Here's a normal mapping shader I often use now:



Quote: "An I idea would be to use a colorkey instead of the alpha channel or DBP's transparency command. How would I do change it to a color key instead of alpha channel?"


My immediate reaction is that it won't be easy because colour components are read as floats in a shader - and testing for equality with floats is usually a bad idea. There may be a way though.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 27th Jan 2010 04:27 Edited at: 27th Jan 2010 05:09
Well for the colorkey it could be set to 0 (black) and then a simple greater than compare would work. But then you might have the issue of color bleeding, so you might get blackish outlines around the non-transparent parts.

Also I have the shader working as it should now. Everything looks great.

Some areas for optimization might be a 3x3PCF filter instead of a 4x4. This will be much faster. Also, I want to add the terrian texture blending shader together with this one. I want to have a shaders that can do outdoor scenes that blend together. If the lighting paramaters + normal mapping take the same values and produce the same results you can mix different shaders together without much worry that things won't "look" correct in the final rendered scene.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 28th Jan 2010 07:38 Edited at: 28th Jan 2010 09:54
I added in colorkey = 0 and its working. I think its pretty decent. Here is the shader.



EDIT: I have attached the entire working project. I think it could use a bit of tidying up but the concept works and everything looks really good. I even included normal maps made with knot-so.

Attachments

Login to view attachments
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 29th Jan 2010 13:08 Edited at: 29th Jan 2010 13:11
You've made good progress getting this working.

The alpha mapping on the leaves isn't quite right yet as you can see from this screenshot - but the shadows and normal mapping look good.



I haven't studied your code in detail yet but did have a quick look and noticed that the specular light wasn't affected by the shadow. For example, you have in the shader:



I think both components, diffuse and specular, should be affected by the shadow, i.e.



would be more logical. Otherwise objects that are completely shadowed will still reflect light which isn't physically possible. Or did I miss something in the code?

Attachments

Login to view attachments
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 30th Jan 2010 10:08
Yes of course. Its a good thing your here to look over these things. I have an idea for a new shadow mapping shader based on this shadow mapping code. I'm not the greatest at shaders, I still have alot of unanwsered questions about how dbp "knows" what matrix goes to what in the shader. It just doesn't make sense.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 30th Jan 2010 21:30
My main problem I keep running into is the huge frame rate / performance drop when using the 4x4PCF filtering.

I have a few ideas on how to overcome this, but I would like some input/ideas.

What if the shadow and scene parts were put into seperate shaders. Then you would draw the shadow map first. Then you could apply a simple blur shader and then you wouldn't have to do the blur in the final render.

maybe a distance check on how much you blur might help???? Open to ideas here.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 31st Jan 2010 01:22
Quote: "My main problem I keep running into is the huge frame rate / performance drop when using the 4x4PCF filtering."


That is a problem. You could drop to 3x3 filtering - or even no filtering. In practice it's best to use the technique rather selectively - i.e. not all objects.

I've just been playing an up-to-date game by a well-known game company and in one scene I noticed the main player had a shadow which followed the player's movement, but all the other shadows were either fixed or non-existent. Most of the time you don't notice such things when playing.

Shadow mapping isn't the only method of getting shadows of course - and I don't yet know how it compares with the others in terms of visual quality and speed.

Quote: "Then you would draw the shadow map first."


It is drawn first - or do you mean the shadows themselves rather than the shadow map (more correctly the depth map)?

If you blur the final scene, where's the gain? In fact it's likely to be worse because the whole scene probably has to be blurred. With shadow maps you can achieve savings by restricting the objects which receive shadows.
david w
18
Years of Service
User Offline
Joined: 18th Dec 2005
Location: U.S.A. Michigan
Posted: 2nd Feb 2010 15:09
Ok I'm trying to approach the problem with a different solution. I want to do what this guy is doing on this page.
http://www.cs.unc.edu/~zhangh/technotes/shadow/onebigfig.jpg

//note this is done for a final fullscreen quad render.

I have the first steps down. I have two renders 1 from the lights view and one from the cameras. I'm running into a problem computing the final shadow map.
here are my shaders:

//shader that stores depth to texture



My Combine and make shadow map shader:



There isn't a problem with the first shader, its working like it should. The second shader, Im a bit confused as to how exactly I use the two maps to make a final shadow texture, that gets overlaid on scene.

Need help with this one. Thanks.
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 2nd Feb 2010 19:25
Variance shadow maps should normally allow you to filter any region of the shadow map in constant time using the built-in filtering modes.
darkvee
19
Years of Service
User Offline
Joined: 18th Nov 2005
Location:
Posted: 4th Feb 2010 18:58 Edited at: 4th Feb 2010 19:01
Hi this is the first time I posted on this subject.
I saw your example Green Gandalf on how to make a normal map generator which is pretty cool.

How would you do this on the shader without doing it in darkbasic pro like you did?

darkvee
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 4th Feb 2010 23:45
Quote: "I saw your example Green Gandalf on how to make a normal map generator which is pretty cool.

How would you do this on the shader without doing it in darkbasic pro like you did?"


The basic idea and calculation is the same. You need to sample adjacent pixels in the U and V directions from the bumpmap (or the main texture as in my DBPro code) and convert the colour to height if necessary. You then calculate the slope in the U and V directions and finally the normal itself. All these steps mimic the steps used in the DBPro code - but written in HLSL of course and scaled accordingly.

I haven't tried this myself because there's likely to be quite a performance hit because of the extra texture reads and computation needed - even more so if you want smoothing as well. But I'm sure something along these lines can be done.
Aubergine
14
Years of Service
User Offline
Joined: 19th Jan 2010
Location:
Posted: 5th Feb 2010 10:52
Is this ever possible on dbpro? Merging small fragments of vshaders and pshaders into one completely other massive function?
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Feb 2010 12:25
Quote: "Is this ever possible on dbpro?"


No. Well not in DBPro itself as far as I know.

However, your code snippet looks like shader asm code to me so I don't see why you can't do that in your shader - and I suppose you can do something similar in HLSL. I guess the component "*.vsi" files would need to be written in a mutually consistent manner. If the shader compiler accepts it then DBPro should accept the compiled result.

I can only suggest you try experimenting with some simple examples to see if you can get something working. That's how I usually set about this sort of thing - plus reading suitable documentation and examples of course.

I'll try to find something about this myself - but don't expect instant results. For some odd reason I seem to have a stack of queries to look into...
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 5th Feb 2010 12:41
You can definitely include shaders in shaders, however, if I remember correctly, if your shader contains some errors, DBPro will return a completely unrelated error message.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 5th Feb 2010 21:24
Are you sure it's DBPro's fault rather than DBPro merely reporting the output of the FX compiler (which has nothing to do with DBPro)?
Math89
20
Years of Service
User Offline
Joined: 23rd Jan 2004
Location: UK
Posted: 6th Feb 2010 01:04
Well, if I remember correctly FX Composer reports the correct error (but I don't think it proves anything).
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 6th Feb 2010 14:07
Interesting, I'll take a look later.
Aubergine
14
Years of Service
User Offline
Joined: 19th Jan 2010
Location:
Posted: 9th Feb 2010 10:56
Is there anyway i can define a #DEFINE in a shader from Dbpro?
Something like; set effect definition "#define BLINN_SHADING"
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 9th Feb 2010 12:30 Edited at: 9th Feb 2010 13:36
this may be helpful, i have copied this from @motion blur@ thread




dear Green Gandalf! could you please provide example of ddx() and ddy() usage? i know that you have explained this before but i cant find it.
although afair i have not made working example for myself.

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Feb 2010 14:03
Quote: "dear Green Gandalf! could you please provide example of ddx() and ddy() usage? i know that there were discussions before but goolge can't find 'em.
although afair i have not made working example for myself."


I've managed to find a simple one on my old computer.

I probably deleted it because it doesn't work as well as I would like - but it does show you how you can use those functions.

I'll tidy up the demo a bit and post it later - but don't expect anything exciting.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Feb 2010 21:04
Quote: "I'll tidy up the demo a bit and post it later - but don't expect anything exciting."


Here it is.

Would someone else like to produce a more exciting demo of the ddx() and ddy() HLSL functions?

Attachments

Login to view attachments
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 9th Feb 2010 21:43 Edited at: 9th Feb 2010 21:47
well, thanks for demo, but it does not gave me any clue about these commands...

i have found this:
http://msdn.microsoft.com/en-us/library/ee418290(VS.85).aspxbut this although makes no sense...

so, i THINK that this commands somehow can return info about object position offset...

the goal is to use them in motion blur shader for moving objects.

(btw, i hope, my english is not so bad?)

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 10th Feb 2010 00:30
Quote: "but it does not gave me any clue about these commands"


I guess not.

ddx() calculate the change in its argument with respect to changes in the screen x coordinate (the horizontal coordinate). ddy() does the same using the y, i.e. vertical, coordinate. The shader uses this to estimate the slope of the "surface" represented by the image - the height of the surface at any given screen pixel is given by the sum of the colour components. The two slopes are then used to estimate the normal vector of the surface - the information which is usually stored in a normal map.

Quote: "but this although makes no sense"


Which bit of that document? Have you done any calculus in your Maths courses, i.e. differentiation, integration, etc?
mr Handy
17
Years of Service
User Offline
Joined: 7th Sep 2007
Location: out of TGC
Posted: 11th Feb 2010 11:09 Edited at: 11th Feb 2010 11:13
Okay, thats much better explanation than This function computes the partial derivative with respect to the screen-space x-coordinate.
So, last question before i'll start my own ddx() demo (i hope i will be able to do it and post here):
with respect to changes in the screen x coordinate - change of what? texel, pixel, UV's...

P.S. Which bit of that document? - it has NO usage example.
Have you done any calculus in your Maths courses, i.e. differentiation, integration, etc? - yep. many years ago.6 or 7...i even don't remember when was it

Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 11th Feb 2010 12:33
Quote: "with respect to changes in the screen x coordinate - change of what? texel, pixel, UV's..."


I agree the document doesn't make it clear what scale the function uses for the screen coordinates - a bit of experimentation using suitably constructed images should help. It might be using something like the screen coordinates used in the final projection to the screen which I think range from -1 to +1 as you go across the screen. If number of pixels were used you'd have scaling problems when you change the screen resolution. However, the SDK docs seem to suggest they do in fact mean pixels wich I find surprising:

Quote: "Projection Space
Projection space refers to the space after applying projection transformation from view space. In this space, visible content has X and Y coordinates ranging from -1 to 1, and Z coordinate ranging from 0 to 1.

Screen Space
Screen space is often used to refer to locations in the frame buffer. Because frame buffer is usually a 2D texture, screen space is a 2D space. The top-left corner is the origin with coordinates (0, 0). The positive X goes to right and positive Y goes down. For a buffer that is w pixels wide and h pixels high, the most lower-right pixel has the coordinates (w - 1, h - 1
"


I attach a screenshot of the whole page so you can find and read it yourself - it's a useful tutorial.

Attachments

Login to view attachments
Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 16th Feb 2010 15:11 Edited at: 16th Feb 2010 15:42
Hi,
i want to collaborate and give a grain of sand. Some information i found:

http://forums.xna.com/forums/p/3967/19871.aspx
http://www.shadertech.com/shaders/Checker.fx
http://www.gamedev.net/community/forums/topic.asp?topic_id=406932

It seems that this functions are used for shader antialiasing.

page 26: http://developer.amd.com/media/gpu_assets/ShadingCourse_HLSL.pdf

Additional explanation.

http://www.d3dcoder.net/phpBB/viewtopic.php?f=3&t=135

What I think is how used this function for motion blur?, to make an image of the velocity map?.



@ David W: Im very interested in the shader you are currently doing. WIll take a look today or tomorrow morning.
Green Gandalf
VIP Member
19
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 16th Feb 2010 18:20
Some nice examples there. Thanks.

The discussion of dynamic flow control in the ShadingCourse_HLSL.pdf document was interesting and may explain why I've never been able to gain performance gains when I expected some.
Alfa x
18
Years of Service
User Offline
Joined: 1st Jul 2006
Location: Colombia
Posted: 16th Feb 2010 20:12 Edited at: 16th Feb 2010 20:58
Quote: "The discussion of dynamic flow control in the ShadingCourse_HLSL.pdf document was interesting and may explain why I've never been able to gain performance gains when I expected some. "


I have a question thats is very basic, but haven't solved it in a while. What is the difference between fixed function pipeline and programmable function pipeline. Is that teh programmable function pipeline allows you to do dynamic conditional shading?

Login to post a reply

Server time is: 2024-11-23 23:28:06
Your offset time is: 2024-11-23 23:28:06