Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - ProN3rd

#1
I am working on a 3d racing game. Everything works so far, got a nice racing course, a player who camera follows smoothly in loopings and such, as well as three enemies who drive on the track as well. Now, I wanted to apply lights and shading to everything and I read a lot in this forum and tries so many things, but cant make it work properly.

This is the code in short (often speaks more than thousand words):

Code (glbasic) Select

WHILE TRUE
X_MAKE3D 1, 1000, 90

//Setting the camera
X_CAMERAUP Cam.front, Cam.side, Cam.up
X_CAMERA Cam.x, Cam.y, Cam.z, Cam.dx, Cam.dy,Cam.dz

//Light Rendering
FOREACH e IN Enemies[]  //Three enemies in total, shall have a 90degree light at their front vector
X_SPOT_LT e.number, e.color,e.x, e.y, e.z, e.frontx, e.fronty, e.frontz, 90
  NEXT

//Object Rendering
FOREACH o IN self.object[];   //All objects are rendered (Racing course, Enemies, Players etc..)
X_MOVEMENT o.x,o.y,o.z
X_SETTEXTURE o.tex,-1
X_DRAWOBJ o.obj ,0
NEXT

X_MAKE2D
SHOWSCREEN
WEND


I tried to include the command:
Code (glbasic) Select

X_SPOT_LT -3, color,x,y, z, 0,0, 0, 360


after the pipeline, and rendered the object agains. I also tried the value of "-2" for toon shading and took some code from the examples file of glbasic:

Code (glbasic) Select

X_LOADSHADER(13, "shader/toon.vert", "shader/toon.frag")
  DIMDATA cheap[], .5, 1
    DIMDATA nice[], .3, .6, .6, .6, .6, .6, .6, .7, 1, 1, 1, 1, 1, 1, 1, 1
X_SETCELSHADES nice[]


however I cant get shadows working at all, and the lights  arenot very bright. I tried Cullmode 1 and -1 as well as using bump mapping and ambient light. I cant even describe what i did and what failed. I am just an amateuer and hope someone can explaine properly how can i achieve the following things:

draw the objects (racing course, vehicles)
4 bright Spotlights in total for each vehicle.
shading

enclosed a little screenshot (with only 1 enemy, and without skybox) I reduced everything to the bare minimum for these testings:

#2
EDIT: Das mit der Hecke hab ich hinbekommen. Ich hab sie nun ganz am Ende (nach allen anderen 3d Objekten) gerendert und nun gehts mit der Transparenz. Ist aber merkwürdig, die Reihenfolge sollte doch egal sein oder?

Hey liebe Leute,

ich versuch gerade diesen Vogel ans Laufen zu bringen: http://opengameart.org/content/evil-crow-creature :)

Hab die neuste Version von Blender geladen und das Ganze als 3ds exportiert. Mit dem GL Tool dann in ddd umgewandelt. Bei der Konvertierung werden mir auch 101 frames angezeigt. Das Problem ist das aber nur der erste frame angezeigt wird:

X_DRAWANIM vogel, 0, 101, permil, TRUE

auch mit X_DRAWOBJ vogel, frame, seh ich nur etwas wenn frame auf 0 steht.

Die zweite Frage: hab auch eine obj Hecke konvertiert und reingeladen ( http://opengameart.org/content/free-hedges)
hier erhalte ich allerdings schwarze Flächen die nicht ausgeblendet werden. Hab die Einstellungen (X_MIPMAPPING TRUE; X_CULLMODE 1) und auch verschiedene Sachen mit den Texturen probiert (png vs BMP, mit ohne alpha),

anbei ein screenshot


p.s noch eine kleine Frage: Sollte ich die  Objekte direkt an der richtigen Position erstellen, oder hinterher beim rendern mit X momvement an die richtige pos verschieben?
#3
EDIT: solved it, i figured some pixel values were not set as INTEGERs, what caused the errors in the assignment to the array

I have been working on a portal based rendering graphics engine, like DukeNukem, Shadow Warrior and the like, where the screen gets renderened in vertical lines. For each x coordinate there are at least three y- lines (floor,main,ceiling), and often more when other sectors are seen through respective portals.

Everything works fine and smooth, until i started using the setpixel instruction instead of drawline. I figured out from the forum that setpixel does not use opengl and is quite slow therefore.

However to apply textures and lightning, i need individual pixel access, so i had the idea to write the pixels to a pixel buffer instead of drawing immediate points. I think this is also the way its done with SDL c++.

Anyway the following code works horrible. It works somehow and has quite good speed compared to setpixel but I can barley recognize the scene: between 50k and 70k pixels are lost out of 307.000 (640 x 480) and dont get rendered at all, it seems like.

How can i deal with this?

Code (glbasic) Select

GLOBAL W = 640, H = 480
LOADSPRITE "texture.png", 0  //640x480 dummy
GLOBAL pix%[];SPRITE2MEM(pix%[], 0);
MEM2SPRITE(pix%[], 1, W, H)  //work with this copy

WHILE TRUE
  CalculatePixels()  // All pixels get assigned in here
  MEM2SPRITE(pix%[],1,W,H)
  DRAWSPRITE 1, 0,0
  Showscreen
WEND
#4
i have been trying for a few days now, and read a lot in this forum but i still cant figure out how to compile for android.
this is the code:
Code (glbasic) Select

WHILE TRUE
DRAWRECT 20,20,100,100,RGB(255,0,0)
SHOWSCREEN
WEND


i tested with GLBasic IDE, Version: 12.308 and now I use GLBasic IDE, Version: 12.096, the problems are the same:

Code (glbasic) Select

_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.060 SN:bdf43d6f - 3D, NET
Wordcount:4 commands
compile+link:
running glb_build.bat
Using ANDROID_TARGET="android-8"
You can use "C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android\glb_android_build.bat" to change the API level and SDK path.



BUILD STAGE 1: Compile and pack RELEASE
Error: Target id 'android-8' is not valid. Use 'android.bat list targets' to get the target ids.
Build failed
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
BUILD STAGE 2: Build DEBUG and install on device
Buildfile: build.xml does not exist!
Build failed
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
finished Android build-script.
Android=C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 5.2 sek. Zeit: 04:39
Erstellen: 1 erfolgreich.


apk file is not created.

i have a freh installation of Java SDK (32 Bit) 8.0 Update 31, i use the variables:


  • JAVA_HOME: C:\Program Files (x86)\Java\jdk1.8.0_31
    ANDROIDSDK: C:\Android\android-sdk
    Path: %JAVA_HOME%\bin

I have emulated various APIS from API 19 (4.4.2) onwards and various devices. I can install other (non gl basic coded) apk files on Android sdk.

Reply39 (in this thread) dropbox link  wont work any more, I tried it a few days ago but lost it during reinstalling.

I have also GLBasic IDE, Version: 10.202 installed, and it works there in so far as the app gets installed. But when I want to open it on the virtual device, it sais "Unfortunately <App Name> has stopped. I also tried the "ANDROTEST.apk" which I found in some thread here and which is known to work. However i get the same error message after installing via cmd.

For all test i delted icons and the distribute folder, or made entirely new projects. Please help me either make GLBasic IDE, Version: 10.202 work, or the new version. Is there a known configuration which works? What GLBasic IDE, JDK,Android API version run without errors?

EDIT: Now downloading and testing this from reply33 in this thread: http://www.glbasic.com/forum/index.php?topic=9166.msg90174#msg90174

the result is:
Code (glbasic) Select


_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.060 SN:bdf43d6f - 3D, NET
Wordcount:4 commands
compile+link:

running glb_build.bat
Using ANDROID_TARGET="android-19"
You can use "C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android\glb_android_build.bat" to change the API level and SDK path.

Checking Icons (uses 'AndroidExtras_icons_X.png' For changes)....
C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android
C:/Users/Gans/Documents/GLBasic/8feb/icon_36_AndroidExtras.png is missing (36x36 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_36_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_36_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-ldpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_48_AndroidExtras.png is missing (48x48 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_48_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_48_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-mdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_72_AndroidExtras.png is missing (72x72 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_72_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_72_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-hdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_96_AndroidExtras.png is missing (96x96 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_96_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_96_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xhdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_180_AndroidExtras.png is missing (180x180 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_180_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_180_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xxhdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_192_AndroidExtras.png is missing (192x192 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_192_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_192_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xxxhdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_ouya_AndroidExtras.png is missing (732x412 size)
the Ouya icon is not important, if you dont want to support the console
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_ouya_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xhdpi/ouya_icon.png
Checking Icons Finished...

BUILD STAGE 2: Start compiler (android.bat)
Q:\Compiler\platform\android\bin\..\android-sdk-windows
Error: Target id 'android-19' is not valid. Use 'android.bat list targets' to get the target ids.
.
BUILD STAGE 3: Build a debug build
Buildfile: build.xml does not exist!
Build failed
.
BUILD STAGE 4: Build a release build
Buildfile: build.xml does not exist!
Build failed
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
HOW TO INSTALL? Install by invoke this command:
"Q:\Compiler\platform\android\bin\..\android-sdk-windows\platform-tools\adb.exe" install -r "C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android/bin/glbasic-debug.apk"
.
HOW TO SIGN? Sign it by invoke this command:
"Q:\Compiler\platform\android\bin\glb_code_sign.bat" "C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android"
.
Android=C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 7.6 sek. Zeit: 05:33
Erstellen: 1 erfolgreich.


still no apk file, a bunch of icons were created

EDIT 2: Now testing the Android icons from post 41 in this thread

Result: didnt change anything:

Code (glbasic) Select

_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.10.060 SN:bdf43d6f - 3D, NET
Wordcount:4 commands
compile+link:

running glb_build.bat
Using ANDROID_TARGET="android-19"
You can use "C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android\glb_android_build.bat" to change the API level and SDK path.

Checking Icons (uses 'AndroidExtras_icons_X.png' For changes)....
C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android
C:/Users/Gans/Documents/GLBasic/8feb/icon_36_AndroidExtras.png is missing (36x36 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_36_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_36_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-ldpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_48_AndroidExtras.png is missing (48x48 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_48_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_48_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-mdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_72_AndroidExtras.png is missing (72x72 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_72_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_72_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-hdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_96_AndroidExtras.png is missing (96x96 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_96_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_96_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xhdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_180_AndroidExtras.png is missing (180x180 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_180_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_180_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xxhdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_192_AndroidExtras.png is missing (192x192 size)
C:/Users/Gans/Documents/GLBasic/8feb/icon_192_AndroidExtras.png is created
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_192_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xxxhdpi/icon.png
C:/Users/Gans/Documents/GLBasic/8feb/icon_ouya_AndroidExtras.png is missing (732x412 size)
the Ouya icon is not important, if you dont want to support the console
copy C:/Users/Gans/Documents/GLBasic/8feb/icon_ouya_AndroidExtras.png to C:/Users/Gans/Documents/GLBasic/8feb/distribute/Android/res/drawable-xhdpi/ouya_icon.png
Checking Icons Finished...

BUILD STAGE 2: Start compiler (android.bat)
Q:\Compiler\platform\android\bin\..\android-sdk-windows
Error: Target id 'android-19' is not valid. Use 'android.bat list targets' to get the target ids.
.
BUILD STAGE 3: Build a debug build
Buildfile: build.xml does not exist!
Build failed
.
BUILD STAGE 4: Build a release build
Buildfile: build.xml does not exist!
Build failed
Picked up _JAVA_OPTIONS: -Xms256m -Xmx512m
.
HOW TO INSTALL? Install by invoke this command:
"Q:\Compiler\platform\android\bin\..\android-sdk-windows\platform-tools\adb.exe" install -r "C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android/bin/glbasic-debug.apk"
.
HOW TO SIGN? Sign it by invoke this command:
"Q:\Compiler\platform\android\bin\glb_code_sign.bat" "C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android"
.
Android=C:\Users\Gans\Documents\GLBasic\8feb\distribute\Android
erfolgreich
_______________________________________
*** Fertig ***
Dauer: 5.7 sek. Zeit: 05:44
Erstellen: 1 erfolgreich.


Spacefractal:
Property ant might been missing as Various required Builds tools?

Im Thinks you should remove ANDROIDSDK from the Path, so glBasic uses that one that is include.

Also im also uses Java JDK 1.7, not Java JDK 1.8.

Also make sure to restart after removing ANDROIDSDK var.

Ps. I'm checkout the none wifi crash in the few days.
#5
und zwar ist der Programmordner an die 50 MB gross und es wird alles vor der Hauptschleife geladen nach dem Schema:

Code (glbasic) Select

GLOBAL bild1 = GENSPRITE(); LOADANIM "Stuff/bild1 .png", bild1 , 32,32
GLOBAL jumpsound = GENSOUND();LOADSOUND "playerjump.wav", jumpsound,0
//und so weiter und so fort, ingesamt 50MB Daten


Dadurch entsteht ein 3 Sekunden Blackscreen bevor das Startmenu zu sehen ist, und bei "normal schnellen" Computern - ohne SSD - sogar bis zu 10 Sekunden.

Natürlich könnte ich zunächst nur die Menugrafiken laden und den Rest erst später, aber das würde das Problem nur verschieben. Ich will einen "Loading Screen" machen, aber wie soll das gehen? Ich will ja praktisch alle 1 MB oder so, einen Balken rendern mit der Anzeige, wieviel schon geladen wurde.

Das zweite Problem bezieht sich ebenfalls auf Ladezeiten: Beim Mapwechsel (falls Level gewechselt wurde) wird eine andere mp3 abgespielt:

Code (glbasic) Select

If levelchange = TRUE and level = level1
   currentmusic$ = "stage1.mp3"
   PLAYMUSIC currentmusic$,TRUE
   levelchange = FALSE
ENDIF


Wenn ich also einen solchen Raum betrete, laggt, es, als wenn die frames krass droppen würden für kurze Zeit.

P.S.: Update() läuft fix mit 30 ticks, und Render() wird entsprechend interpoliert
#6
Hey liebe Leute, hab folgendes Problem:

Code (glbasic) Select

SETCURRENTDIR("Media") // go to media files
GLOBAL stage = GENSPRITE(); LOADSPRITE "stage.png", stage

GLOBAL l1stage = GENSPRITE()
GLOBAL l2stage = GENSPRITE()

WHILE TRUE
test(2)
DRAWSPRITE l1stage,100,100
DRAWSPRITE l2stage,300,300
SHOWSCREEN
WEND

FUNCTION test: value
LOCAL dummy$
IF value = 1
dummy$ = "l1"
ELSEIF value = 2
dummy$ = "l2"
ENDIF
dummy$+stage = stage

ENDFUNCTION



der fehler ist die letzte Zeile in der Funktion. Hab schon einiges ausprobiert, auch mit "" bei beiden Variablen aber leider ohne Erfolg. Also wenn ich die Funktion mit 1 aufrufe, soll er l1stage = stage machen und ansonsten eben l2stage = stage, damit das entsprechende Bild zugewiesen wird