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 / Render Object Twice - Different Textures per pass

Author
Message
tparkin
17
Years of Service
User Offline
Joined: 28th Mar 2007
Location:
Posted: 10th Dec 2007 21:28
Doing multitexturing with a shader and need to set (change) textures per pass. I read that if I create a shader with 2 passes DarkGDK will automatically run them in sequence. How can I modify the textures used for the second pass?

Is there another way to do this - to use only one pass but render the object twice and set the effect parameters for the textures differently each time? I need both renders of the object to blend (additive blending)
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 12th Dec 2007 20:32
I'm daft here - but I recently ran into a command called FASTSYNC or thereabouts - its a lightweight "partial" sync I've seen in some effect stuff using cameras - underwater shaders - wonder if that would help some how.

tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 28th Dec 2007 14:25
Quote: "Is there another way to do this - to use only one pass but render the object twice and set the effect parameters for the textures differently each time?"


Why don't you render the object twice using single-pass shader? Then you can change the texture between each draw. Actually it is not common to make multiple passes when they are same.
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Dec 2007 14:45
tempicek - how is that done? Every other sync? (flashy I'd guess) or using that fast sync command somehow?

How do you render an object twice? (Make two?)

I know with DirectX directly - you can change how stuff is rendered, forward, backwards.. I don't know much about it but I saw code for such tricky in a texture blending how to.

tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 28th Dec 2007 19:25
Quote: "How do you render an object twice? (Make two?)"


I'm sorry, I was wrong. Now I realized that you actually can not fully control the order of object rendering in each frame (or do you?). Thats a pity and a big nasty flaw which seems to make me looking for some other product if I don't find a way how to do this :/
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Dec 2007 20:03 Edited at: 28th Dec 2007 20:13
fast sync GDK cam, then directx directly try to render it?

[edit]
^^^^^^^^^^ um... Bad English.

I mean - Do you think there is a way you maybe use DirectX and GDK together (and independantly) to acheive the effect you're after?

I recommended fastsync command, though I don't know much about it - but it seems like it draws the directx surface - but doesn't send it to vid card - meaning swap backbuffer "yet".

tempicek
16
Years of Service
User Offline
Joined: 27th Nov 2007
Location: Prague
Posted: 28th Dec 2007 20:56
Quote: "I mean - Do you think there is a way you maybe use DirectX and GDK together (and independantly) to acheive the effect you're after?"


Sure, once you have a pointer to D3D device, you can do anything. So technically - Yes. Practically - No, because the DGDK graphics engine is useless then. You do need the control over rendering order if you want to squeeze some speed out of the machine.

Regarding the FastSync - the documentation says that it only omits processing of Windows messages, so not a big gain.


Anyway, to get back to the original post - it's still possible to set two textures to a model and use a single pass shader which combines both textures at once. This can not supply every effect, but in most cases it should do the trick (and is even faster than multiple rendering!).
jason p sage
17
Years of Service
User Offline
Joined: 10th Jun 2007
Location: Ellington, CT USA
Posted: 28th Dec 2007 21:29
I SO Believe that and was trying to get an "Old School" Pixel Shader working in preference to a newer FX shader because their were about 4 to 6 assembly instructions, and all seemed to be similiar to basic Intel Opcodes like mov edx, [memaddrs] where the CPU is working in RAW NATIVE HORSEPOWER mode. Versus - a higher level hlsl shader or whatever.

I don't know much about this yet - but I REALLY REALLY want to try to get a 6 to 8 layer TEXTURE BLENDER with alpha control to mix them. I THINK this will run faster than vertex/normal shaders written to do terrain like I'm experimenting with now (because I couldn't get pixel shader to work in DarkGDK)

Login to post a reply

Server time is: 2024-10-08 15:59:54
Your offset time is: 2024-10-08 15:59:54