Not exactly sure I understand what you want to achieve. But from what I understand you want the resulting color to be "blown out", i.e. go brighter than the diffuse-texture color right? Sounds like default behavior to me. I mean, the equation is diffuse light * diffuse texture. So by having a light source which is above…
Hello all, I'm starting my journey into shader programming and In many respects I just don't quite know where to begin. I've opened up some HLSL shader files and messed around (with some success) but I feel like I'm blindly poking around in the dark. Does anyone have some good resources for learning HLSL and or GLSL? I've…
I haven't started writing my own shader from scratch yet. I'm working on an expansion pack for a game that happens to need a graphical update. The graphics programmer at our company is booked solid working on another title. So we're having to make due with a programmer who's never done graphics before and myself. We're…
Wow... so much good information here already and I have a feeling we're just getting started! I never knew that screen mode was a hack in gamma space. That makes perfect sense because when compositing in shake or nuke with linear renders you don't use screen for reflections either.
You could pick up one of these great DVD's: http://www.cg-academy.net/es_catalog/product_info.php?products_id=64 http://eat3d.com/shaders_intro I made some very basic intro videos here: http://www.cgbootcamp.com/tutorials/category/cgfx cgfx and hlsl are essentially the same btw. reflections are added, you will not be using…
@artquest - are you interested in learning this stuff on a theoretical level or for actually practical use? The discussion is advancing very quickly but it would be much more productive if we could see some of your code and help you along in manageable steps. For example, you should really get a shader working with one…
If you work with GLSL and want for editing purposes quick feedback you can use the cgc.exe (cg compiler) it will accept regular GLSL (even ES). That way you get error messages and even some code that hints to the low-level generation www.luxinia.de/index.php/Estrela/Shader (for my own editor I've built myself some…
I did it like so(this is for one light only, but not hard to change for more): float4 Blinn( pixelIn input ) : COLOR { input.lightDir = normalize( input.lightDir ); input.viewDir = normalize( input.viewDir ); input.normal = normalize( input.normal ); float dotNormalLightDir = dot ( input.lightDir, input.normal ); float…
You need to know when to saturate (clamp to 0-1) and when to use max() to ensure only positive numbers without limiting yourself to the 0-1 range. If something makes sense as 0-1 values (like the return on a dot(N,L) ) you can saturate it but when you start adding up multiple lights you will get values greater than 1 and…