About Store Forum Documentation Contact
Donations:
309$/mo



Post Reply 
Noob Question about Viewports/Renderer
Author Message
Ozmodian Offline
Member

Post: #1
Noob Question about Viewports/Renderer
Hi All,

So i am trying to render a view from a second camera in the upper right hand side of the screen. However when I do this, the render window/viewport is slightly transparent so the image gets distorted by what is "behind" the viewport. If it moves over well lit terrain, it changes siginficantly. Is there a way to make it so that the image "behind" the viewport is not slightly transparent?

As an example, i opened the Tutorial -> 14 - Game Basics -> 14 - Camera Modes. If you create "Camera Cam2;" at the beginning and then replace the draw function with the following, you will see what i mean. I have also attached a short video showing the issue.

Code:
Camera mainCam = Cam;
   Renderer(Render);
   D.text  (0, 0.9, "Press Tab to switch camera modes");
  
    Cam2.set();
   D.viewRect(Rect(1.0, 0.5, 1.25, 0.75));
  
   Renderer(Render);
   mainCam.set();
   D.viewRect(null);




(This post was last modified: 05-03-2013 05:38 AM by Ozmodian.)
05-03-2013 05:22 AM
Find all posts by this user Quote this message in a reply
Rubeus Offline
Member

Post: #2
RE: Noob Question about Viewports/Renderer
Check out the render to texture tutorial. You could try to render your smaller camera view to a texture similarly to how you are doing it now and draw the texture up in that corner.
05-03-2013 02:23 PM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #3
RE: Noob Question about Viewports/Renderer
Yeah, I know that is possible but I want to understand why these images are blending together. My goal really is to understand how the engine works and all it capabilities.

Thank you for the advice though Rubeus, it is very much appreciated.
05-03-2013 03:22 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #4
RE: Noob Question about Viewports/Renderer
Can you attach the full code of your app?
With the changes you've mentioned I cannot reproduce the issue. (the small camera is not the same as in your video)
05-03-2013 03:59 PM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #5
RE: Noob Question about Viewports/Renderer
Shoot, yeah, i forgot 1 line in init()

Cam2.setFromAt(Vec(10, 10, 10), Vec(0, 0, 0), 0);

I have attached the full code.

Thanks


Attached File(s)
.txt  Sample.txt (Size: 5.91 KB / Downloads: 8)
05-03-2013 04:11 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #6
RE: Noob Question about Viewports/Renderer
Thanks, I've reproduced the issue (it occurs only on DX9, it works fine on DX10+).
I'll try to fix it.
05-03-2013 05:39 PM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #7
RE: Noob Question about Viewports/Renderer
Ohh, that explains it. Sounds like an excuse to upgrade my graphics card to me!!

I feel better that I was doing it right though. I think i tried nearly every Render Mode and Alpha mode you have thinking that I was doing something wrong there.

Thanks as always for your help.
05-03-2013 05:54 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #8
RE: Noob Question about Viewports/Renderer
Can you tell me if it works ok in DX9 if you set this code:
D.shadowSoft(false) - (disable shadow softing in InitPre)
05-03-2013 06:30 PM
Find all posts by this user Quote this message in a reply
Ozmodian Offline
Member

Post: #9
RE: Noob Question about Viewports/Renderer
Yes, that does indeed fix the problem.
05-03-2013 06:44 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #10
RE: Noob Question about Viewports/Renderer
Ok, I've just managed to fix this smile it will work ok in next release.
05-04-2013 02:14 PM
Find all posts by this user Quote this message in a reply
Post Reply