Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: DirectX specific FX - how to do it?  (Read 2764 times)

0 Members and 1 Guest are viewing this topic.

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
DirectX specific FX - how to do it?
« on: September 09, 2006, 12:38:29 AM »

Greetings, everyone.
I have following (DirectX related) problems:
1) I need to create a geometry primitive in WME, that changes it's vertex positions and topology frequently. (every frame). This object needs to be completly procedural, so no skeletal animation usage is possible.
2) I need to render a scene from another point of view, and put image to the texture, that will be used on that object.
3) I need to use a vertex\pixel shader with that object.

Those task can be easily accomplished in PURE DirectX C++ code, but it looks like i just don't have access to all required funcionts\events\interfaces. For example - I didn't find something like "OnReset"or, at least, "WM_SIZE event handler". It's possible to create render targets using given IDirect3DDevice8 interface (by the way, why don't you use DirectX9?), but they will be certainly lost during device reset, that occurs every time user switches(Alt-Tab) windows. Such unreleased interfaces (not only render targets, stateblocks, and many other interfaces) will cause ineventiable crash.
What is the solution?

P.S.It looks like it would be much simpler for me just to rewrite entire graphic-related section of program, but, unfortunately, source code is not awailable...
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: DirectX specific FX - how to do it?
« Reply #1 on: September 09, 2006, 05:45:37 PM »

Well the least I can do at this point is to send the reset/restore events to plugins.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

ErV

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 54
  • I regret nothing!
    • View Profile
Re: DirectX specific FX - how to do it?
« Reply #2 on: September 09, 2006, 09:23:27 PM »

Well the least I can do at this point is to send the reset/restore events to plugins.
Is this functionality already implemented?

more questions:

And what about rendering scene to texture? Can I call something like "RenderScene" from a plugin?
Can I implement custom actor\scene file format via the plugin? Can I access actor bone transformation from a plugin and change it? Can I apply custom transform (skewing, for example) to an object? Do you enable specular highlits? (IDirect3DDevice8->SetRenderState(D3DRS_SPECULARENABLE, TRUE)? Do you enable D3DRS_NORMALIZENORMALS (this MUST be enabled for 3D animated actors, since bone transformations almost always contains scaling. Scaling will cause normals to be non-unit length, and that will, in turn, cause lighting artefacts (overbrighting).) Which states are set during render? Will texture on second\third state removed during render call? Will be a vertex\pixel shader removed? Is the hardware acceleration enabled for devices with D3DDEVCAPS_PUREDEVICE?

Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: DirectX specific FX - how to do it?
« Reply #3 on: September 10, 2006, 04:03:01 PM »

Is this functionality already implemented?
No, not yet.

And what about rendering scene to texture? Can I call something like "RenderScene" from a plugin?
Can I implement custom actor\scene file format via the plugin?
Can I access actor bone transformation from a plugin and change it?
No. The plugins are limited to accessing scripting attributes and methods, and a few additional internals.


Do you enable specular highlits?
Do you enable D3DRS_NORMALIZENORMALS
Yes.

Which states are set during render? Will texture on second\third state removed during render call? Will be a vertex\pixel shader removed? Is the hardware acceleration enabled for devices with D3DDEVCAPS_PUREDEVICE?
No, currently only the first texture stage is used, no shaders, to HW T&L.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.04 seconds with 24 queries.