Author Topic: sampling mode  (Read 7977 times)

Offline influt

  • byte
  • *
  • Posts: 25
    • View Profile
sampling mode
« on: November 04, 2008, 12:51:58 pm »
Hello.

I am using a canvas renderer. Can I set sampling mode other than SAMPLINGMODE_NORMAL and how?
I've tried both setting mode to SAMPLINGMODE_GL_AA_2X and SAMPLINGMODE_GL_AA_4X, but that didn't make any effect. Although i saw that aptalkarga uses canvas renderer, too, and a user can switch between sampling modes there.

any help will be appreciated.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: sampling mode
« Reply #1 on: November 04, 2008, 06:35:49 pm »
You are using the AWTGLCanvas-Renderer? If so, AA (i.e. the sampling mode) depends on your hardware. Which graphics card is that and do you have a screen shot? karga uses the software renderer, that's a different thing.

Offline influt

  • byte
  • *
  • Posts: 25
    • View Profile
Re: sampling mode
« Reply #2 on: November 04, 2008, 11:12:19 pm »
You are using the AWTGLCanvas-Renderer? If so, AA (i.e. the sampling mode) depends on your hardware. Which graphics card is that and do you have a screen shot?
Yes, it is AWTGLCanvas-Renderer. I'll make a screenshot a bit later..
karga uses the software renderer, that's a different thing.
Ok, another question: How can i make a canvas renderer use software renderer mode? Because when i try to do the following:
Code: [Select]
canvas = buffer.enableGLCanvasRenderer(IRenderer.RENDERER_SOFTWARE);
it is the same as buffer.enableGLCanvasRenderer(IRenderer.MODE_LEGACY), as i understand, and LEGACY renderer is no longer supported

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Re: sampling mode
« Reply #3 on: November 04, 2008, 11:24:30 pm »
enableGLCanvasRenderer ... look at the GL word. it means it uses OPEN GL, that means hardware renderer. if you want to hace software render on a canvas just put the render stuff on the paint methos over an awt canvas. There are some examples over there. On the download section, there is a project called Maze, it was my first jpct applet, it may help you.
Nada por ahora

Offline influt

  • byte
  • *
  • Posts: 25
    • View Profile
Re: sampling mode
« Reply #4 on: November 05, 2008, 11:26:04 am »
enableGLCanvasRenderer ... look at the GL word. it means it uses OPEN GL, that means hardware renderer. if you want to hace software render on a canvas just put the render stuff on the paint methos over an awt canvas. There are some examples over there. On the download section, there is a project called Maze, it was my first jpct applet, it may help you.
Thanks, Melssj5. I understood. how could i have missed that..

Now about hardware renderer. Here is a screenshot done at 640x480 and SAMPLINGMODE_NORMAL:


when switching to AA_2X or AA_4X no error message occurs and i see a blank screen or exactly the same picture as with SAMPLINGMODE_NORMAL. The application is developed and tested on an on-board Intel 82915G/GV/910GL VGA with the latest drivers from Intel.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: sampling mode
« Reply #5 on: November 05, 2008, 01:42:26 pm »
Intel onboard graphics stink when it comes to AA (well, not only then...). If the hardware and/or the driver doesn't support it, it doesn't work. Try to get a cheap ATI or NVidia (any will do) and you should get the AA you want.

Offline influt

  • byte
  • *
  • Posts: 25
    • View Profile
Re: sampling mode
« Reply #6 on: November 05, 2008, 02:15:45 pm »
I can do so, of course, and i already have nvidia at home. But this app is developed for ordinary people, and big percent of those buy a pc with on-board-everything  ;) so i think that i should better use sw renderer..

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Re: sampling mode
« Reply #7 on: November 05, 2008, 03:08:57 pm »
BTW: Which app is it?

I am working on something via applets focused for ordinary people too. This app is about watching house plans, doing a virtual walkthrough, and making them able to change dinamicly the floors, wall, and ceiling textures to get and aproximation of the final cost of the construction project. Its a Thesis project but the 3d part is delayed until finishing all the  documentation and the web page to admin that.

Is your app something similar??
Nada por ahora

Offline influt

  • byte
  • *
  • Posts: 25
    • View Profile
Re: sampling mode
« Reply #8 on: November 05, 2008, 03:30:09 pm »
No, i am making a simple metaverse, something similar to aptalkarga. Maybe, in the future the project will grow into something more complicated, maybe not :)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: sampling mode
« Reply #9 on: November 05, 2008, 06:19:34 pm »
I can do so, of course, and i already have nvidia at home. But this app is developed for ordinary people, and big percent of those buy a pc with on-board-everything  ;) so i think that i should better use sw renderer..
The absence of AA on Intel onboard chips shouldn't prevent you from using the hardware renderer IMHO. I can only enable what the driver allows me to do. On Intel, you should spot some messages about "number of samples (xxx) not supported" when AA fails to initialize. That shouldn't really matter, because jPCT falls back to normal sampling in that case.
You may also support hardware and software renderer in one application.

Offline influt

  • byte
  • *
  • Posts: 25
    • View Profile
Re: sampling mode
« Reply #10 on: November 10, 2008, 12:00:53 pm »
Hey, I've tested the same code on NVidia GeForce 2 MX 400 and the same problem occurred. That is, i can not init buffer with AA. When passing AA_2X or AA_4X to FrameBuffers' constructor, i see the same picture as without AA.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: sampling mode
« Reply #11 on: November 10, 2008, 12:18:22 pm »
That's because a GF2 can't do multi sampling AA.