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.

Dark GDK / Why is the refraction map rendering so slow here?

Author
Message
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 25th Mar 2013 00:03 Edited at: 25th Mar 2013 00:04
I'm writing a game engine and have came upon a slowdown issue that is just not good enough.
I'm using Evolved's fresnel water shader (link) and have pretty much ported his example code directly to DarkGDK, albeit I have modularized it a bit.

Here's the main code part for it; I'm using some of my own classes but I don't think that's what's slowing it down - as you can see I've timed just the would-be "sync" part from dbpro (which is wrapped as Camera::render(fastsync_boolean) in my library).
What this function does is it sets the sync mask to the given camera if it isn't already and then calls dbSync(fastSyncFlag):


The weird thing is that the refraction camera's "sync call" takes between 40 - 80 milliseconds to complete (it differs since I'm culling objects depending on the beholder position*), while the reflection rendering lies between 1 - 14 milliseconds. The main render pass ("camera 0") is also timed and ends up at 3 - 11 milliseconds in my test scene.
Thus, it is obvious that the refraction render takes way more time than the other cameras and I just cannot figure out what would cause this. Do anybody have any ideas?

Also, although probably quite a different question, my rendering speed drops quite significantly when increasing the UV tiling on my terrain. This is also something which I don't think is usual (yes, it has mipmapping enabled) and if anybody have some information on that I would be happy to hear it as well.

Thanks for any hints,
- A frustrated Rudolpho


---------------------
* The culling information is only updated for the main camera, not for the ones used to render the shader maps here.


"Why do programmers get Halloween and Christmas mixed up?"
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 25th Mar 2013 12:18
Forum rubber ducking for the win... hehe.
Turns out the problem lied in the way I was wrapping UV coordinates in my terrain shader. A hint to anybody doing this, the modulo operator works with floats in HLSL....


"Why do programmers get Halloween and Christmas mixed up?"

Login to post a reply

Server time is: 2024-11-18 21:39:30
Your offset time is: 2024-11-18 21:39:30