Popular Post stgatilov Posted January 17 Popular Post Report Posted January 17 The engine has a rather cool feature of rendering perfect planar reflections using mirrorRenderMap. But it is well known that this feature can be costly, because it requires the whole world (in the worst case) to be rendered twice. There has been a request to support lower-resolution rendering to reduce GPU load (5485). This feature is added in 2.14 with new material parameter mirrorResolutionFactor. For example, in order to make mirrored rendering with 1/3 x 1/3 of native resolution, you can write the following in your material: mirrorRenderMap mirrorResolutionFactor 0.333 Of course, this has a downside of making the mirrored view more blurred. But I've seen materials which explicitly blur the rendered view, distort it, or blend with other effects, etc. In these cases the lack of crispness of the reflections is not that ugly. The second change is related to the similar feature remoteRenderMap. There has been a way to specify resolution for this feature already, but it has some weird behavior and thus is now deprecated. If you have a square screen and want it to be rendered at 512 x 512 pixels, then you can write: remoteRenderMap remoteResolution 512 512 A slightly more convoluted way is to specify three numbers: remoteRenderMap remoteResolution 1024 1024 10.0 It means: render 10.0 pixels per 1 doom unit, but limit resolution by 1024 x 1024. So if the screen is of size 64 x 64 doom units, then it will be rendered at resolution 640 x 640, if it has size 16 x 16 units, then it will be rendered at resolution 160 x 160, but if it is stretched over 200 x 200 screen, then it will be rendered at resolution 1024 x 1024 because of the cap. There is also another limit for the remote screen resolution, which is applied at the end: see below. Finally, TDM 2.14 includes a few generic optimizations for these two features: Remote screen resolution is now capped by its size on the screen. So if a remote normally has 512 x 512 resolution but the player looks at it from far enough and it occupies only 100 x 100 pixels on the screen, then the rendering resolution is lowered to 128 x 128. This is controlled by cvar r_remoteLimitResolutionByScreenSize. Mirrored view image was previously copied at fullscreen resolution. Now the copy is limited to bounding rectangle/scissor, which means wasting less GPU bandwidth for mirrored surfaces which cover a small portion of the screen. Remember however, that all the resolution/scissor tweaks can only reduce GPU load. They don't simplify the work of the renderer frontend. So if the game is CPU-limited, none of this helps. 7 2 Quote
Bikerdude Posted January 18 Report Posted January 18 20 hours ago, stgatilov said: This feature is added in 2.14 with new keyword mirrorResolutionFactor. For example, in order to make mirrored rendering with 1/3 x 1/3 of native resolution, you can write the following in your material: mirrorRenderMap mirrorResolutionFactor 0.333 The second change is related to the similar feature remoteRenderMap. There has been a way to specify resolution for this feature already, but it has some weird behavior and thus is now deprecated. If you have a square screen and want it to be rendered at 512 x 512 pixels, then you can write: remoteRenderMap remoteResolution 512 512 A slightly more convoluted way is to specify three numbers: remoteRenderMap remoteResolution 1024 1024 10.0 Is there a wiki for how to where to use/add these args? As in on the entity directly or in the material..? Quote
stgatilov Posted January 18 Author Report Posted January 18 1 hour ago, Bikerdude said: Is there a wiki for how to where to use/add these args? As in on the entity directly or in the material..? There is no wiki yet. The quoted lines are from material declaration of course. That's where you usually write mirrorRenderMap and remoteRenderMap, right? Now you can specify extra parameters for them nearby. 1 Quote
kingsal Posted January 20 Report Posted January 20 Nice! How will this handle normal , spec, and diffuse maps in those materials? Will they render "on top" of the mirrored image? Quote Volta and the Stone / Volta II: Cauldron of the Gods / Volta III: Gemcutter Snowed Inn / Hazard Pay / Moongate Ruckus
stgatilov Posted January 21 Author Report Posted January 21 23 hours ago, kingsal said: Nice! How will this handle normal , spec, and diffuse maps in those materials? Will they render "on top" of the mirrored image? I think they should work just like they do usually. Diffuse/specular/normal are interaction stages, they are processed as groups on per-light basis. All the other stages are ambient ones, they are rendered after light interactions are done (if I'm not mistaken). These "RenderMap" stages are also ambient, they differ in taking the texture from special source (and applying it with special texcoords in case of mirror). Quote
kingsal Posted January 22 Report Posted January 22 @stgatilovRoger that, thanks for the info. Quote Volta and the Stone / Volta II: Cauldron of the Gods / Volta III: Gemcutter Snowed Inn / Hazard Pay / Moongate Ruckus
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.