Good question Jacky. As you see, you need to explicitly provide code for every additional light, it adds performance cost, and if you want to optimize in case there are fewer lights, you get branching as an additional issue: doing IF's in shaders is not as straightforward as regular cpu code, shaders are meant for the GPU…
Shadertoy is nice, but I will say something, half of those codes are insane! The Flame one is the perfect example of this, that thing is one heavy mofo that won't be used in an FPS for a LOOONG time...but would be still awesome to use :D
Yeah it is coming along really well, thanks for asking. I stopped just following tutorials and have been learning more about the syntax and what stuff is doing. For example I didn't know what the "In" (or Out) part of everything meant. As a beginner I didn't realise that it was something called In that you had named, I…
Again: UDK is a good start; but it doesn't allow straight translation to code, which is really crucial to make the step away from nodes. It's also limited since it presents you a partially fixed shader, you can't easily go and replace the lighting model for example. I wouldn't recommend FXComposer, never been a fan of it.…
hmm, the 0x003 is probably because some of the application inputs are not coming in correctly, or because some WorldViewProject conversions are messing up. If you see this sort of stuff, where the geometry is just going nuts, it means that the very basic code that converts the raw 3d-model coordinates to its screen-correct…
Hey man, I can give you some advice here I guess. Don't get scared/confused by these complicated sounding articles that try to explain the vertex-pixel shader pipeline in a lot of detail. They might make it sound like it's all about this complicated big system and how it ties into the graphics hardware. That stuff is…
You would do some of the stuff in HLSL, but things will be a lot more spread out. the majority happens in the actual render framework code of the application. I've never wirtten this stuff before, but to say it simplified you would have a few simple shaders (or one with multiple techniques) for the passes: one that purely…
There are a couple of things you probably should change here. :) -First thing is when you are transforming your tangents, normals, and binormals into 'world space'. They naturally are in world space, so simply pass them to your fragment shader straight from the application. For example:Out.worldNormal =…