Jump to content
Sign in to follow this  
sxp2high

Render to Texture Examples

Recommended Posts

Render to Texture (RTT) Examples

aka Picture in Picture (PiP)

Using and editing the demo missions

- Just extract the rar file to your missions folder "Users\USERNAME\Documents\Take On Helicopters\Missions".

- Open the in-game Editor and load the example mission.

- Open the SQF files with an text editor. I recommend Notepad++ with C++ Syntax highlighting and a mono space font, like Consolas.

Related links, threads and tutorials

- SQF syntax

- camera.sqs

- Unit Rec/play + Camera training.

- Spawn a helo with camera

1. Basic usage with camera, changing texture renders on-the-fly and multiple "rendertargets"

rtt1.jpg

Download Demo Mission

List of Commands that I used in this Demo:

2. Using heli mounted cameras, auto-zoom and user controlled camera changes (Zoom and FLIR)

rtt_heli.jpg

Download Demo Mission

List of Commands that I used in this Demo:

Edited by sxp2high

Share this post


Link to post
Share on other sites

Fantastic thing :)

one day i hope to get to play with more ,

Keep up good work and Knowledge sharing it will keep this game alive ;)

Share this post


Link to post
Share on other sites

really nice demo mission

but perhaps it's better not to use "rendertarget0" - "rendertarget2" but own names (perhaps with author tags) when creating rendertargets (with cameraEffect)

because those names are used for the mirrors in cars/helis

Share this post


Link to post
Share on other sites
but perhaps it's better not to use "rendertarget0" - "rendertarget2" but own names (perhaps with author tags) when creating rendertargets (with cameraEffect)

because those names are used for the mirrors in cars/helis

Yep, you're totally right. Didn't thought of that. :thumbsup:

Share this post


Link to post
Share on other sites

It will be up soon, by tomorrow I think.

It's a lot more regarding heli mounted cameras I'm going to demonstrate. Auto-zoom, manual zoom, switching target, switching to FLIR, etc. Almost everything you'll need to create a camera-based scenario. :)

Share this post


Link to post
Share on other sites
It will be up soon, by tomorrow I think.

It's a lot more regarding heli mounted cameras I'm going to demonstrate. Auto-zoom, manual zoom, switching target, switching to FLIR, etc. Almost everything you'll need to create a camera-based scenario. :)

wow, are you hired by BIS? Is this for Arma 3? it better be! :D

Share this post


Link to post
Share on other sites

Sorry about the delay, didn't had much time to finish it yet. But I'm almost done. Will post it asap.

Is this for Arma 3?

I think Render To Texture is on the "confirmed features" list for ArmA3. :thumbsup:

Share this post


Link to post
Share on other sites

Just a little bit fun based on your script...

The camera follows players so it's basically for MP (others can watch what a randomly selected player is doing, all players are seeing the same player):

sdjdzakkat9q.jpg

Xeno

Share this post


Link to post
Share on other sites

Hmm ,

this would make good scenario for multiplayer

timetrial mission maybe 6 players , 1 pilot 5 spectators watch the helo and then next person take turn to fly :) , just sit and watch the screen until its your turn ?

its possible with this script ?

Prize = You was there and had fun :)

Share this post


Link to post
Share on other sites

Has anyone tried these examples with the latest 1.04 release candidate? I was going to try something similar with Java, but I can't even get the first example mission working. The scripts "work", but the three screens remain black (sometimes white). I've tried moving closer or farther away, but all I have achieved is causing the game to CTD...

I'm using a GTX260 with 295.73 drivers.

Share this post


Link to post
Share on other sites

Ok, I was able to solve the problem with the images not rendering by tweaking my video options.

But now I have a a problem that has me stumped... the camera is pointing in (approx) 180 degrees the wrong direction. See this screen shot.

Note that in the screenshot the camera is projecting images that contain the shadows from the screens themselves. So the camera is working, it is just pointed in the wrong direction. The parts of the demo that change the mode (TI, Color Correction, etc) work just fine, and the bit with the three screens displaying three different modes at once works. But anything that involves moving, zooming or re-aiming the camera doesn't.

I've made no changes to the mission, and just downloaded a new copy to take this screenshot.

Edited by Slapstick
Fixed grammar and spelling

Share this post


Link to post
Share on other sites
Ok, I was able to solve the problem with the images not rendering by tweaking my video options.

I had same problem and used same fix :( however some still dont work just show blackout with some pixelating blue black ocasionally )

It really is hard to debug now there adding three new shader bollocks in toh.cfg , i am on verge of giving this up until i am on the dole / retired its all a bit of needle and haystack at the moment .

Share this post


Link to post
Share on other sites

I went ahead and ported (most of) the mission to Java and the Java mission works (and doesn't work) in exactly the same manner as the SQF mission. So either something has changed in the game engine or I'm still having settings/driver issues.

Share this post


Link to post
Share on other sites

there is some new Renderto texture changes in the latest Beta try them now, could have fixed your problems

Share this post


Link to post
Share on other sites

And indeed it did. The first time I tried the SQF mission I had a CTD with a popup dialog from nVidia saying the graphics card drivers had crashed and been restarted. However, subsequent attempts ran fine and both missions (SQF and Java version) worked as expected. The nVidia updater just notified me that new drivers are available so hopefully all will be good now.

Share this post


Link to post
Share on other sites

Nice one

Yeah just got the Nvidia pop up too , hopefully it will fix the alt tab retardness i am having lately too

Share this post


Link to post
Share on other sites

Hi neo,

check out the first example mission, it's all there.

It's pretty easy really. Just create a cam and set the object texture to the rendertarget (cam):

_cam = "camera" camCreate (getPosATL player);
_cam camPrepareFov 0.700;
_cam camPrepareTarget (vehicle player);
_cam camCommitPrepared 0;
_cam cameraEffect ["INTERNAL", "BACK", "rendertarget0"];


_screen setObjectTexture [0, "#(argb,256,256,1)r2t(rendertarget0,1.0)"];

This is for objects only, and only for objects, which have hidden selections defined. (setObjectTexture compatible)

For cockpit displays you have to use BIS_fnc_PIP. (Second example mission)

If you need further assistance, please be more specific, what you are not getting :)

Share this post


Link to post
Share on other sites

Thanks sxp2high,

Exactly what I meant.

_screen setObjectTexture [0, "#(argb,256,256,1)r2t(rendertarget0,1.0)"];

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×