Author Topic: Couple of newbie questions  (Read 19728 times)

0 Members and 1 Guest are viewing this topic.

Murmandamus

  • Thug
  • *
  • Posts: 20
Couple of newbie questions
« on: May 13, 2008, 12:11:14 PM »
Hi all,

I'm trying to set up a basic app framework for my Demoniak experiments, and ran into a couple of newbie questions. Just in case, you can download my (very small) test project here: http://www.basilisksolutions.com/Simple.zip (it contains - and needs - the folders "common" and "Simple", to run it, extract both folders somewhere and load Simple/main.xml into Demoniak). Here are my questions:

1: What is the correct way to set a fixed physics timestep? For example, let's say I want the physics to run 100 times per second. This is what I tried (the comments on each line are taken directly from http://www.ozone3d.net/demoniak3d/devguide-v1/api_hyp_lua_physics.php#SetTimingParams ):
Code: [Select]
HYP_Nx_Physics.SetTimingParams(
    0.01, -- max_time_step - [REAL] - Maximum size of a substep - .
    1,    -- max_iter - [INTEGER] - Maximum number of iterations to divide a timestep into.
    1,    -- is_timestep_fixed - [INTEGER] - use(1) or not use(0) a fixed time step.
    0.01  -- timestep_to_use - [REAL] - time step to use when is_timestep_fixed=1.
);
I assume the timing values should be specified in seconds, or should it be in milliseconds (in which case I should change the 0.01 to 10)? In any case, I tried different values but it does not seem to have any effect, judging from the framerate and from the value returned by HYP_GetTimeStep().

2: Related to the previous question, it looks as though the simulation always runs as fast as possible (i.e. the physics timestep may be 0.01s, I don't know, but in any case it's not running in sync with real time). With vsync disabled it runs at over 360fps. If I slow it down by enabling vsync, it runs at 60fps and you can see the cube drops a lot slower. So the question is, how can I synchronize the simulation time with real time? UPDATE: This is apparantly a known issue and will hopefully be improved in a future version.

3: About nx_misc_data (used in the mesh xml tag):
- What is the difference between actor_type DYNAMIC and KINEMATIC? UPDATE: Found the answer in the docs for HYP_Nx_Physics.SetActorKinematicState.
- If I set density to some value (like 1) and mass to 0, will the actual mass be automatically calculated and set correctly?

4: I'm no expert on lighting, but the way I understand it is that ambient light means the level (and color) of light in the entire scene, and diffuse is the color of an object (theoretically, the color reflected by the object if white light is shining on it). Then what does the ambient value on an object material mean? And what does the diffuse value of a light node mean? In other words, what is the difference between ambient and diffuse in those cases, or how should I use them?

5: I have a light with shadow_emitter="TRUE" (high up in the sky like a sun), and a cube with shadow_caster="TRUE". Why don't I see the cube's shadow on my floor plane? UPDATE: Seems like this works on some machines (thanks Shadow) and not on others (e.g. mine). Still not known why.

6: The timer and mesh picking callbacks don't seem to work. Any thoughts?

7: I tried adding a cube with 1 segment on each side, by setting the segs attributes to 1, and that didn't work. However, if I set those attributes to 2, then I get the cube I want (with 1 segment to each side, as seen in wireframe mode). Is this a little bug?

8: Using HYP_Nx_Physics.GetActorCollisionPoint, does the length of the collision normal vector tell me the force of that contact point?

9: How does HYP_Nx_Physics.SetActorPairFlags work (i.e. how do I get notification about these events), and what are the default settings?

10: Is it possible to change friction parameters of physics bodies? UPDATE: Yes, see docs for HYP_Material.Set[Static|Dynamic]Friction (thanks JeGX).

11: Pressing the escape key quits Demoniak3D. I've tried HYP_Input.DisableDefaultKeyboardFunctionalities() and HYP_Input.SetDefaultInputManagementState(0) but the escape key still exits the program. I'd like to be able to use the escape key for other things (without it quitting Demoniak3D), and also to be able to quit Demoniak3D programmatically from Lua (i.e. by calling HYP_Quit or something). Is this possible? UPDATE: It's on the wishlist.

12: I know I can see if a specific key is pressed using HYP_Input.IsKeyboardKeyPressed. I'd like to check if the user pressed *any* key (and which one). But the only way I can think of to do it now, is to check every key individually with HYP_Input.IsKeyboardKeyPressed, but this is probably not very efficient to do every frame. Is there another way to do this? UPDATE: It's on the wishlist.

13: What is effectively the difference between primitives and their corresponding mesh types (for example HYP_Primitive.CreateSphere vs. HYP_Mesh.CreateSphere, etc)?


Any help would be greatly appreciated  :byebye:

Cheers
« Last Edit: May 16, 2008, 09:35:15 PM by Murmandamus »

Murmandamus

  • Thug
  • *
  • Posts: 20
Re: Couple of newbie questions
« Reply #1 on: May 13, 2008, 12:31:59 PM »
Hmm about question 5, I have an OMNI light, but I probably need a SPOT light for shadows... Will try that.

EDIT: nope that doesn't help...
« Last Edit: May 13, 2008, 12:44:47 PM by Murmandamus »

shadow

  • Capo Regime
  • ***
  • Posts: 353
Re: Couple of newbie questions
« Reply #2 on: May 13, 2008, 01:20:10 PM »
Quote
5: I have a light with shadow_emitter="TRUE" (high up in the sky like a sun), and a cube with shadow_caster="TRUE". Why don't I see the cube's shadow on my floor plane?
Actually I do see a shadow under the cube...

3D, photos panoramiques : http://www.shadows.fr

Murmandamus

  • Thug
  • *
  • Posts: 20
Re: Couple of newbie questions
« Reply #3 on: May 13, 2008, 06:42:32 PM »
That's odd... This is what it looks like on my pc (nVidia 8800 GS):
http://www.basilisksolutions.com/simple.png

shadow

  • Capo Regime
  • ***
  • Posts: 353
Re: Couple of newbie questions
« Reply #4 on: May 13, 2008, 07:18:38 PM »
I just tried it on another PC (8600gts), and I still have the shadow... :etonnes:
3D, photos panoramiques : http://www.shadows.fr

Murmandamus

  • Thug
  • *
  • Posts: 20
Re: Couple of newbie questions
« Reply #5 on: May 13, 2008, 07:22:14 PM »
Could it be that shadows are only enabled in the Pro version of Demoniak..? I really don't know what else it could be :etonnes:

shadow

  • Capo Regime
  • ***
  • Posts: 353
Re: Couple of newbie questions
« Reply #6 on: May 13, 2008, 08:02:15 PM »
Quote
Could it be that shadows are only enabled in the Pro version of Demoniak..?
I wasn't using the pro version.  :transpi:
3D, photos panoramiques : http://www.shadows.fr

Murmandamus

  • Thug
  • *
  • Posts: 20
Re: Couple of newbie questions
« Reply #7 on: May 13, 2008, 08:17:19 PM »
Just checking :thumbup:

Murmandamus

  • Thug
  • *
  • Posts: 20
Re: Couple of newbie questions
« Reply #8 on: May 14, 2008, 08:03:16 AM »
Hi all,

I found the answer to one of my questions (difference between physics actor type DYNAMIC and KINEMATIC, see Lua reference for HYP_Nx_Physics.SetActorKinematicState). Initial post updated.

I also added some new questions to my first post.

If anyone knows anything about these questions... Any info is welcome :med:

Cheers!

Murmandamus

  • Thug
  • *
  • Posts: 20
Re: Couple of newbie questions
« Reply #9 on: May 14, 2008, 01:06:10 PM »
Updated initial post.

JeGX

  • Global Moderator
  • Capo Crimine
  • *****
  • Posts: 2385
    • oZone3D.Net
Re: Couple of newbie questions
« Reply #10 on: May 15, 2008, 08:12:05 AM »
5: I have a light with shadow_emitter="TRUE" (high up in the sky like a sun), and a cube with shadow_caster="TRUE". Why don't I see the cube's shadow on my floor plane? UPDATE: Seems like this works on some machines (thanks Shadow) and not on others (e.g. mine). Still not known why.
What is your rig ? Mainly what is your graphics system: use GPU Caps Viewer to retrieve that info.
Have you tried the demos that come with this tutorial: http://www.ozone3d.net/tutorials/glsl_lighting_phong.php ?

Murmandamus

  • Thug
  • *
  • Posts: 20
Re: Couple of newbie questions
« Reply #11 on: May 15, 2008, 10:30:49 AM »
Hm weird. I downloaded the zip at the end of that tutorial, ran each of the 5 xml files in it, and made a screenshot of each. I'm pretty sure something is not right :P as you can see here:
http://www.basilisksolutions.com/point_light_att_demo.png
http://www.basilisksolutions.com/point_light_demo.png
http://www.basilisksolutions.com/spot_light_att_demo.png
http://www.basilisksolutions.com/spot_light_demo.png
http://www.basilisksolutions.com/spot_light_enhanced_demo.png

Btw I mentioned previously in this thread that I have a GeForce 8800 GS, but I confused the letters, it's an 8800 GT. See here for the caps viewer:
http://www.basilisksolutions.com/devcaps.png

EDIT: Corrected the last link...
« Last Edit: May 15, 2008, 10:34:55 AM by Murmandamus »

JeGX

  • Global Moderator
  • Capo Crimine
  • *****
  • Posts: 2385
    • oZone3D.Net
Re: Couple of newbie questions
« Reply #12 on: May 15, 2008, 12:21:05 PM »
Very weird indeed. Your graphics system seems ok.
I've just done again the test with shadow-volumes, and they work fine (point_light_demo.xml).

With NVIDIA boards, this kind of bug shouldn't exist. Try the latest Forceware: Forceware 175.16 WHQL and let me know.

Murmandamus

  • Thug
  • *
  • Posts: 20
Re: Couple of newbie questions
« Reply #13 on: May 15, 2008, 01:20:12 PM »
Ok I'll try that and let you know. Btw since I installed that caps viewer tool, I get three errors in sequence whenever I launch Demoniak3D:
http://www.basilisksolutions.com/errors.png

I've uninstalled the caps viewer tool, and now I don't get those errors anymore. Not a clue why this happened.

EDIT:
In case it matters, I have demoniak installed at D:\Demoniak3D\ and the caps viewer was installed in D:\Demoniak3D\GPU_Caps_Viewer_v1.4.2\
I just tried installing the caps viewer again, but without running it. Same errors. After uninstalling it again, errors are gone.

UPDATE:
This time I installed the caps viewer to its default location, and I don't get the errors now.


Btw the text on the error popups is in dutch, it means it can't find the entry point of the specified procedure, in the specified dll file.
« Last Edit: May 15, 2008, 01:28:04 PM by Murmandamus »

Murmandamus

  • Thug
  • *
  • Posts: 20
Re: Couple of newbie questions
« Reply #14 on: May 15, 2008, 02:57:13 PM »
Ok, I installed the new drivers as you suggested. Unfortunately, the results are exactly the same, for all of the phong demos as well as my own project.

New caps screen: http://www.basilisksolutions.com/newdriver.png