Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I also asked about this over on the UDK forums, but haven't had much luck getting any responses. Basically, I have some experience with UT3 modding, but I'm just getting started with the UDK, and I have a few questions about the degree of control over the rendering you have.

  1. I gather that, despite the presence of several HLSL shader files in the UDK distribution (with the extension .usf), there is no means of implementing your own shaders outside of the material editor; is this correct? (I know about the Custom node in the material editor, but it's very limited, and unwieldy for all but the simplest logic.)

  2. I understand that UE3 employs deferred rendering. I know you can access the color and depth at the current pixel in a post process. However, is there any way to access these or other G-buffer attributes in a more general way? (Normals, position, values at neighboring pixels...)

  3. Are render targets supported in a general way? For the sake of argument, would it be possible to set up a camera to render depth from an alternate POV, then do shadow map-style depth comparisons while rendering the main view?

  4. Is it possible to override all the materials on the client (en masse), such as those being used for the terrain or BSP geometry in the current level? (For implementing alternate vision modes and things of that nature.)

The tools that come with the UDK are of course very polished, and it's hard to beat free Scaleform and SpeedTree, but I'm starting to think the platform is a terrible fit for anyone who wants to go above and beyond drag-and-drop material editing in terms of graphics. I feel like I have much more control over the rendering in a Source engine mod, for example.

share|improve this question
    
I would love to hear from anyone experienced in UDK on these issues –  jcurrie33 Aug 20 '10 at 20:42
add comment

3 Answers 3

  1. I seriously don't see a lot which couldn't be done with MaterialEditor. You can do almost everything that you need. One could argue that the material-editor isn't generating optimal shader-code, but the shader-compiler does a great job in optimizing the autogenerated code here. So, just try it. A lot of AAA games were developed with this toolchain and a lot of these just worked completely with materials built whith this editor. But to answer your question: No, this is not possible with the plain UDK.

  2. UE3 does not use deferred rendering. The shadowing system uses a kind of deferred technique on top of the forward renderer. But the renderpipeline is not deferred at all, so no G-Buffer or anything like that are available. More info about this: http://www.unrealtechnology.com/Downloads/Slides/xfest-gfx.ppt Unfortunately I was not able to find other publicly available documentation of the internals of UE3 with a quick search, so I hope this presentation gives you a good overview. The access of neighboring pixels is possible out of the box. Take a look at the DOF or Bloom posteffect. I am not sure if this is implemnted in code or via the Material-Editor, but if it is in the MaterialEditor, than you should be able to find an working example for this.

  3. You should take a look at the SceneCaptureActors. These can be used for render-to-texture stuff, but I'm not sure how much tuning possibilites you have for the out-of-the box UDK actors. You than can use this rendered texture in a material. Unfortunately your specific case ( rendering the depth ) is not supported in the UDK out of the box.

  4. No, this is not possible, but you could do a workaround by using Material-Parameters which are handled in the Material ( so one material would contain the shader for both modes ). You than can change the Material parameters via Kismet, which would allow you to do exactly what you need.

In my opinion there isn't a lot that you can't do with the UE3 rendering-wise. The drag-and-drop material editing and the level-editor centric design might be not what a programmer expects, but it is exactly what content-guys are needing. This has proven itself as a really good solution at the end of the day. This of course requires that the content creators know the system and it's limitations.

You should just give it a shot and try to build what you need using the tools the UDK provides. I am very positive that you will be able to get what you want.

share|improve this answer
    
Thanks for the reply. re: #1 - This doesn't answer my question at all. re: #2 - Do you have any citations, or any more information? re: #3 - I know about the SceneCapture* actor classes, but it seems like they're limited to capturing a "normal" view of the scene. I specifically asked about being able to do a projective depth comparison. I've certainly tried to get what I want out of the tools available in the UDK, and that's exactly how I formulated this list of questions. –  Neverender Aug 23 '10 at 19:21
    
Yeah, you are right ... I was dragged away and started to ramble :), sorry for that ... I edited my answer so it is hopefully of more help to you. –  DarthCoder Aug 25 '10 at 10:48
    
Thanks for the additional info. I understand where you're coming from when you say that the material editor is versatile enough for most things. It's unfortunate that it looks like I won't be able to realize this idea using the UDK. Injecting special cases into every single material isn't really a viable approach. –  Neverender Aug 25 '10 at 23:25
add comment
up vote 1 down vote accepted

I realized I should probably update this, in case anyone reading this neglected to click through to the thread on the UDK forums. I was told by a moderator that everything I want to do is impossible without engine modifications.

1) Unfortunately the custom node is the only way to get HLSL into UDK materials.

2) UE3 doesn't do full deferred, so only color and depth are available in postprocess effects. There's currently no node that lets you access position at the current pixel, but it would be very useful (and this calculation is done in lots of shaders like shadow filtering).

3) Rendering from alternate POV's is supported through scene captures, but the only attribute that can be captured is color.

4) This is only possible with changes to engine code.

Basically all the things you are asking about require full access to UE3 source.

Citation: http://forums.epicgames.com/showthread.php?p=27609556#post27609556

share|improve this answer
add comment

For what you're asking, I would not suggest the UDK. You do not have native access.

Even if UDK did provide you script access to what you're asking for, it would be insanely sluggish, as UnrealScript is not the fastest of languages.

Unreal does not use deferred rendering. Where did you hear this? Some licensees have implemented deferred rendering; but, natively, it does not ship with it.

Other than that, I'm not a graphics guy :)

share|improve this answer
    
You don't have access to the UE3 source or native classes, as 'proper' licensees do, so you can't do much deep hacking on the engine per se. But DLLBind (udn.epicgames.com/Three/DLLBind.html) lets you write native code and call it from UnrealScript, which should be enough for optimization purposes. –  user744 Aug 24 '10 at 21:31
    
Thanks for the reply; however, I'm pretty sure most of what I want to achieve could hypothetically be implemented just fine in UnrealScript from a performance standpoint. The performance of the first two things I asked about would mainly be dependent upon the shaders being used, not UnrealScript. For the third and fourth, I would ideally be able to request that the scene be re-rendered into a specified render target, with a specific material that would override all standard materials in the scene. Neither part would be particularly script-intensive; the workload would still fall on the engine. –  Neverender Aug 25 '10 at 23:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.